setting focus on masked textbox control added in datagridview
-
Hi all, can anybody help me out here by providing me a solution. I want to set a focus to masked TextBox control displayed over a cell in CellBeginEdit event. MaskedTextbox.focus() is not working here can anybody help me out ???
-
Hi all, can anybody help me out here by providing me a solution. I want to set a focus to masked TextBox control displayed over a cell in CellBeginEdit event. MaskedTextbox.focus() is not working here can anybody help me out ???
Do it using gridviews findcontrol method.
-
Do it using gridviews findcontrol method.
I have already tried that but no success :( Control[] ctrl = datagridview.Controls.Find("name of textbox", true); ctrl[0].Focus();
-
I have already tried that but no success :( Control[] ctrl = datagridview.Controls.Find("name of textbox", true); ctrl[0].Focus();
Try it like this.
MaskTextBox mt=datagridview.row[0].FindControl("nameof textbox")
mt.setFouus().Hope this works.
-
Try it like this.
MaskTextBox mt=datagridview.row[0].FindControl("nameof textbox")
mt.setFouus().Hope this works.
there is no funciton like FindControl for datagridview and there's no function like setFocus() for maskedtextbox so r u serious in giving this solution?
-
there is no funciton like FindControl for datagridview and there's no function like setFocus() for maskedtextbox so r u serious in giving this solution?
sorry for the late reply. But i just did the same.
t1 = GridView1.Rows(0).FindControl("InstallmentDec") t1.Text = dt.Rows(0)(12).ToString()
Its working for me. Here use Foucus function in place of setting text will work fine.