i have a GridView populated with elements from a Dataset.
StringReader sr = new StringReader(Data);
XmlTextReader xtr = new XmlTextReader(sr);
DataSet ds = new DataSet();
ds.ReadXml(xtr);
GridView1.DataSource = ds.Tables[3];
GridView1.DataBind();
Some columns return either "true" or "false". I want to show the cells in this columns not as text but with the help of a CheckBox. This way i can later update Table
Description:
An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: System.Web.UI.WebControls.ListItemCollection must have items of type 'System.Web.UI.WebControls.ListItem'. '("asp:GridView" ' is of type "System.Web.UI.WebControls.GridView").
Ok i don't know why but now i don't get the error message anymore. I can see the checkBox but at the same time i see the column twice. Once with the CheckBox and then with the string. Is there any way to eleminate the column with the string?
But the output shows all columns inside the xml and the column DocumentView(this is the node inside the xml string that i posted at the beginning) is shown twice: once with the checkbox and the second time with the strings(true/false). How can i show only the
column with the CheckBox?
Member
15 Points
96 Posts
Bind CheckBox with a Dataset in a GridView populated with an Xml-string
Sep 20, 2013 09:01 AM|Tomiu|LINK
Hi Dear Community,
i have a GridView populated with elements from a Dataset.
Some columns return either "true" or "false". I want to show the cells in this columns not as text but with the help of a CheckBox. This way i can later update Table
EDIT: The Xml string looks like this:
dataset gridview checkbox
All-Star
50831 Points
9895 Posts
Re: Bind CheckBox with a Dataset in a GridView populated with an Xml-string
Sep 20, 2013 09:18 AM|A2H|LINK
Hi,
Please try with the below code
Refer this thread for more details
dataset gridview checkbox
Aje
My Blog | Dotnet Funda
Member
15 Points
96 Posts
Re: Bind CheckBox with a Dataset in a GridView populated with an Xml-string
Sep 20, 2013 09:33 AM|Tomiu|LINK
I'm getting this error message:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: System.Web.UI.WebControls.ListItemCollection must have items of type 'System.Web.UI.WebControls.ListItem'. '("asp:GridView" ' is of type "System.Web.UI.WebControls.GridView").
dataset gridview checkbox
Member
15 Points
96 Posts
Re: Bind CheckBox with a Dataset in a GridView populated with an Xml-string
Sep 20, 2013 10:15 AM|Tomiu|LINK
Ok i don't know why but now i don't get the error message anymore. I can see the checkBox but at the same time i see the column twice. Once with the CheckBox and then with the string. Is there any way to eleminate the column with the string?
dataset gridview checkbox
All-Star
50831 Points
9895 Posts
Re: Bind CheckBox with a Dataset in a GridView populated with an Xml-string
Sep 20, 2013 10:22 AM|A2H|LINK
Hi,
Please check whether You bind the datafield(Evaluate) to any other column in GridView Markup?
Also If you have changed your grid view mark up from the code shown above, please post your complete gridview mark up.
dataset gridview checkbox
Aje
My Blog | Dotnet Funda
Member
15 Points
96 Posts
Re: Bind CheckBox with a Dataset in a GridView populated with an Xml-string
Sep 20, 2013 10:37 AM|Tomiu|LINK
Hi,
i use only this inside the GridViw:
But the output shows all columns inside the xml and the column DocumentView(this is the node inside the xml string that i posted at the beginning) is shown twice: once with the checkbox and the second time with the strings(true/false). How can i show only the column with the CheckBox?
Thx
dataset gridview checkbox
All-Star
50831 Points
9895 Posts
Re: Bind CheckBox with a Dataset in a GridView populated with an Xml-string
Sep 20, 2013 10:53 AM|A2H|LINK
Hi,
You need to set the AutoGenerateColumn property of GridView to false.
Try with the below code
dataset gridview checkbox
Aje
My Blog | Dotnet Funda
Member
15 Points
96 Posts
Re: Bind CheckBox with a Dataset in a GridView populated with an Xml-string
Sep 20, 2013 10:56 AM|Tomiu|LINK
Thank you. That worked.
dataset gridview checkbox