Serious GridView Problem!
-
Hello Friends, I am facing a serious gridview problem, I am binding my gridview from code behind like(myGridView.DataSource=myDataSet; myGridView.DataBind()). But the problem is when i click the inbuilt "edit" button of the grid and the rows comes to edit mode, I cant able to get the cell values in any of the event like row_updating etc. For all the "rows(index)cells(index).Text" its displaying the blank text "". I am not able to figure out what the problem is. Please help me out friends.... I have tried all of these commands: 1). lblMessage.Text = CType(CType(e.CommandSource, LinkButton).NamingContainer, GridViewRow).Cells(4).Text 2). Dim m_ColumnText As String m_ColumnText = GV1.Rows(GV1.EditIndex).Cells(4).Text 3). lblMessage.Text = Server.HtmlDecode(row.Cells(4).Text) All are showing blank text, but i have values in my grid cells i can see it from my eyes.....i am very frustrated....plz...plz...help me out. Thanks in advance. :confused: Sheel Gohe
-
Hello Friends, I am facing a serious gridview problem, I am binding my gridview from code behind like(myGridView.DataSource=myDataSet; myGridView.DataBind()). But the problem is when i click the inbuilt "edit" button of the grid and the rows comes to edit mode, I cant able to get the cell values in any of the event like row_updating etc. For all the "rows(index)cells(index).Text" its displaying the blank text "". I am not able to figure out what the problem is. Please help me out friends.... I have tried all of these commands: 1). lblMessage.Text = CType(CType(e.CommandSource, LinkButton).NamingContainer, GridViewRow).Cells(4).Text 2). Dim m_ColumnText As String m_ColumnText = GV1.Rows(GV1.EditIndex).Cells(4).Text 3). lblMessage.Text = Server.HtmlDecode(row.Cells(4).Text) All are showing blank text, but i have values in my grid cells i can see it from my eyes.....i am very frustrated....plz...plz...help me out. Thanks in advance. :confused: Sheel Gohe
-
Hi there, What does your gridview look like? What is the column 4? If the cell 4 simply contains an input control like Textbox in Edit mode, the Text property returns empty.
Yes minhpc_bk, the cell 4 simply contains an input control like Textbox in Edit mode, and the Text property returns empty string "".... Do you know the cause!! Sheel Gohe
-
Yes minhpc_bk, the cell 4 simply contains an input control like Textbox in Edit mode, and the Text property returns empty string "".... Do you know the cause!! Sheel Gohe
Sheel Gohe wrote:
Do you know the cause!!
Yes, :). In Edit mode, the cell does not contain text, but a text box so that the user can input the value, so the Text property of the cell should be empty. And if you want to access the value, you should cast the child control contained in the
Controls
collection of the cell 4 (.Controls[0]
) to the TextBox control, then access the Text property of the textbox. -
Sheel Gohe wrote:
Do you know the cause!!
Yes, :). In Edit mode, the cell does not contain text, but a text box so that the user can input the value, so the Text property of the cell should be empty. And if you want to access the value, you should cast the child control contained in the
Controls
collection of the cell 4 (.Controls[0]
) to the TextBox control, then access the Text property of the textbox.Thanks minhpc_bk, You made my day....I wanted to give many thanks to you....God bless you... :) Sheel Gohe