Click here to Skip to main content
15,911,785 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDatabase Dilemma [modified] Pin
Skyruner217-Jul-06 3:15
Skyruner217-Jul-06 3:15 
AnswerRe: Database Dilemma [modified] Pin
eggsovereasy17-Jul-06 3:49
eggsovereasy17-Jul-06 3:49 
GeneralRe: Database Dilemma [modified] Pin
Skyruner217-Jul-06 3:55
Skyruner217-Jul-06 3:55 
GeneralRe: Database Dilemma Pin
Daniel Santillanes17-Jul-06 6:00
professionalDaniel Santillanes17-Jul-06 6:00 
GeneralRe: Database Dilemma Pin
Skyruner217-Jul-06 7:44
Skyruner217-Jul-06 7:44 
GeneralRe: Database Dilemma [modified] Pin
Daniel Santillanes18-Jul-06 5:19
professionalDaniel Santillanes18-Jul-06 5:19 
QuestionError while calling Web Service Pin
Sathiyaraj Ganesan17-Jul-06 2:34
Sathiyaraj Ganesan17-Jul-06 2:34 
QuestionDynamic CheckBoxList in DataGrid EditItemTemplate read values PROBLEM Pin
voidtech17-Jul-06 2:20
voidtech17-Jul-06 2:20 
I have an DataGrid and a CheckBoxList in EditItemTemplate as shown below:

<asp:TemplateColumn HeaderText="Users">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.user") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBoxList runat="server" ID="rolesCBoxL" EnableViewState="true" AppendDataBoundItems="true" RepeatColumns="2" Enabled="true" ></asp:CheckBoxList>
</EditItemTemplate>
</asp:TemplateColumn>

This CheckBoxList is created dynamically in ItemCreated function:

DataView dv = ds.Tables[0].DefaultView;
for (int i = 0; i < dv.Count; i++)
{
ListItem li = new ListItem(dv[i]["name"].ToString(), dv[i]["id"].ToString());
rcbl.Items.Add(li);
}

So, when i click the Edit button everuything seems to be OK.
CheckBoxList is visible and even i have some selected values OK.
But , i have a problem with getting this values in UpdateCommand function.


CheckBoxList rcbl = (CheckBoxList)e.Item.FindControl("rolesCBoxL");
for (int i = 0; i < rcbl.Items.Count; i++)
{
if (rcbl.Items[i].Selected)
{
// some DB queries
}
}

This code returns me nothing. I made a breakpoint and figured out that the
rcbl.Items.Count is zero. I don't know how to manage that. Does anyone knows the answer
for this question ? HOW TO GET VALUES FROM DYNAMICALLY CREATED CHECKBOXLIST IN EDITITEMTEMPLATE IN DATAGRID ? Thank You.

voidtech
AnswerRe: Dynamic CheckBoxList in DataGrid EditItemTemplate read values PROBLEM Pin
postmaster@programmingknowledge.com17-Jul-06 2:33
postmaster@programmingknowledge.com17-Jul-06 2:33 
AnswerRe: Dynamic CheckBoxList in DataGrid EditItemTemplate read values PROBLEM Pin
voidtech17-Jul-06 2:38
voidtech17-Jul-06 2:38 
AnswerRe: Dynamic CheckBoxList in DataGrid EditItemTemplate read values PROBLEM Pin
voidtech17-Jul-06 2:40
voidtech17-Jul-06 2:40 
QuestionASP.NET [modified] Pin
gankum17-Jul-06 2:00
gankum17-Jul-06 2:00 
AnswerRe: ASP.NET Pin
eggsovereasy17-Jul-06 3:47
eggsovereasy17-Jul-06 3:47 
QuestionMouseover event in Datalist Control Pin
Amit Agarrwal17-Jul-06 0:25
Amit Agarrwal17-Jul-06 0:25 
QuestionDifference between IIS 5.0 and IIS 6.0 architecture Pin
Vivek.Sivasamy16-Jul-06 23:49
Vivek.Sivasamy16-Jul-06 23:49 
AnswerRe: Difference between IIS 5.0 and IIS 6.0 architecture Pin
eggsovereasy17-Jul-06 3:52
eggsovereasy17-Jul-06 3:52 
GeneralRe: Difference between IIS 5.0 and IIS 6.0 architecture Pin
Vivek.Sivasamy17-Jul-06 20:20
Vivek.Sivasamy17-Jul-06 20:20 
QuestionAjax.NET Help documentation Pin
Tiger45616-Jul-06 21:42
Tiger45616-Jul-06 21:42 
AnswerRe: Ajax.NET Help documentation Pin
psamy16-Jul-06 21:47
psamy16-Jul-06 21:47 
GeneralRe: Ajax.NET Help documentation Pin
Tiger45617-Jul-06 2:17
Tiger45617-Jul-06 2:17 
GeneralRe: Ajax.NET Help documentation Pin
Amit Agarrwal14-Aug-06 2:15
Amit Agarrwal14-Aug-06 2:15 
QuestionDataGridView problem when columns amount varies. Help, please! Pin
HilSoft16-Jul-06 21:41
HilSoft16-Jul-06 21:41 
AnswerRe: DataGridView problem when columns amount varies. Help, please! Pin
minhpc_bk16-Jul-06 22:55
minhpc_bk16-Jul-06 22:55 
QuestionHow to use Grouping in Datagrid? Pin
nabeelkhan16-Jul-06 21:33
nabeelkhan16-Jul-06 21:33 
AnswerRe: How to use Grouping in Datagrid? Pin
minhpc_bk16-Jul-06 22:57
minhpc_bk16-Jul-06 22:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.