- Where Developers Learn, Share, & Build Careers
I am writing the asp.net project in c # and I have a little problem.
I have a dropdown list inside a gridview and both of them are initially filled with a database, but different tables (different selection queries).
I want to set the query ToolTip to the list below, which are used to fill Gridwu (Detatale 1) by the following code:
& Lt; Asp: TemplateField HeaderText = "select supervisor" item style-width = "100px" & gt; & Lt; ItemTemplate & gt; & Lt; ASP dropdown list id = "dropdown list 1" Rnat = "server" Otopostbak = "The index turned true" on-selected = "DdlTest_SelectedIndexChanged" tooltip = & lt; (% # ((DataSet1.DataTable1Row) ((DataRowView) Container .datitum) .ro)) .p_id% & gt; & Gt; & Lt; / ASP: DropDownList & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: TemplateField & gt;
But when I try to run the project I get the following error:
Object reference not set to an instance of an object < / Code>
If I try to set up manually tooltip, for example:
ToolTip = "abc"
Without any problems
Does anyone have to set the tooltip for the dropdown list from the database query? Thank you.
I will GridView event each GridViewRow
but only when < Code> GridView becomes databound.
protected void GridView1_RowDataBound (object sender, GridViewRowEventArgs e) {var grid = (GridView) sender; If (E.Rao Silver == Data Controller Type. DATA) {dropdown list dropdown list 1 = (dropdown list) e. Cry. Fund Control ("Dropdown List 1"); Detourovevv = (Detourviewview) E.R.D. Dataset DS = DRV ROBALDetsetSet; // I'm not 100% sure here what you want here, for example: DropDownList1.ToolTip = drv.Row.Field & lt; Int & gt; ("P_id"). ToString (); }}
It is more readable and easy to maintain and debug.
Comments
Post a Comment