help in coding /query for disbaling
-
i have a table with fiELds pARTICULARS , MA, ME, MD, MV, MF, MP (CHAR 1) electronics a e v plastics e d rubber a e d v f p this table is displayed in a grid i need to disable that cell of the grid which is blank at present i have i execute the query with a datareader For I = 0 To grid1.Rows.Count - 1 qry="select particulars from table" if datareader("ma")="" then disable the cell end if if datareader("me")="" then disable the cell end if if datareader("md")="" then disable the cell end if next i am not getting the desired thing . how do i exceute it
-
i have a table with fiELds pARTICULARS , MA, ME, MD, MV, MF, MP (CHAR 1) electronics a e v plastics e d rubber a e d v f p this table is displayed in a grid i need to disable that cell of the grid which is blank at present i have i execute the query with a datareader For I = 0 To grid1.Rows.Count - 1 qry="select particulars from table" if datareader("ma")="" then disable the cell end if if datareader("me")="" then disable the cell end if if datareader("md")="" then disable the cell end if next i am not getting the desired thing . how do i exceute it
-
Hi, How you are binding to gridview, means what am asking is are you using any itemtemplate inside gridview ???????????????
kannak
Hi, The Following code in Inline code, The Following code from code behind in gridview_rowdatabound(), If e.Row.RowType = DataControlRowType.DataRow Then txt1 = CType(e.Row.FindControl("txttmp1"), TextBox) txt2 = CType(e.Row.FindControl("txttmp2"), TextBox) txt3 = CType(e.Row.FindControl("txttmp3"), TextBox) Dim s1 = txt1.Text Dim s2 = txt2.Text Dim s3 = txt3.Text If s1 = "" Then CType(e.Row.FindControl("txttmp1"), TextBox).Enabled = False ElseIf s2 = "" Then CType(e.Row.FindControl("txttmp2"), TextBox).Enabled = False ElseIf s3 = "" Then CType(e.Row.FindControl("txttmp3"), TextBox).Enabled = False End If End If i hope this will works fine....
kannak