check CheckBoxList in DataGrid

M

Mats

Hi

I am working on a webapplication using Asp.net with C#. I
have Datagrid that have 3 colums two of them are text but
the last one is a CheckBoxList. I have manage to set data
to the CheckBoxList but I haven't found a way to select
those checkbox that I will.

I read data from a database and will make a table with two
text columns and one column filled with several
checkboxes. Each row can have different number of
checkboxes with different names. Some of the checkboxes
will be checked some ones not.


<asp:DataGrid id="dg" AutoGenerateColumns="False"
runat="server">
<Columns>
<asp:BoundColumn DataField="Name"
HeaderText="Sidnamn"></asp:BoundColumn>
<asp:BoundColumn DataField="Url"
HeaderText="Url"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Behörighet">
" RepeatDirection="Horizontal"
DataValueField="ValueField" DataTextField="Name"
runat="server" ID="Checkboxlist2">
</asp:checkboxlist>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

The GetData() method is returning a DataView.

I have try to set selection I OnPreRender fore the page
but than I only can set selection I one row.

Can someone help me how to solve it

Thanks
/Mats
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,206
Latest member
Zenden

Latest Threads

Top