i took datagrid in that i placed labels and radiobuttons in datatemplate .
using this i am displaying one question paper. now i want to find out the question no ie
Thanks
P.Nagaraju
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Priya LingeRank #785 · 2.9K reputationPosted Aug 21, 2011, 9:35 PM EDT
You can find the control on loadingevent of datagrid as below,
int ColumnIndex;
void mydatagrid_LoadingRow(object sender, DataGridRowEventArgs e)
{
Label lbl = mydatagrid.Columns[ColumnIndex].GetCellContent(e.Row) as Label;
RadioButton radio = mydatagrid.Columns[ColumnIndex].GetCellContent(e.Row) as RadioButton;
}
Hope this will help you.
Thanks.
nagaraju84 reputationPosted Aug 21, 2011, 10:08 PM EDT
i used ur code but i am getting null values in label as well as radiobuttons.
here by i am sending my questionpaper screent shot . please tell me how to find out the question id and radiobuton. please tell me the column indexes for that labels and radiobuttons.
Thanks
P.Nagaraju
Mahadesh MahalingappaRank #331 · 7.5K reputationPosted Aug 22, 2011, 10:16 AM EDT
nagaraju84 reputationPosted Aug 22, 2011, 7:57 PM EDT
{
Label lbl_Id1 = Qpdatagrid.Columns[0].GetCellContent(this.Qpdatagrid.SelectedItem) as Label;
Qpdatagrid.Columns[0].GetCellContent(que.Option1) as RadioButton;
var optin1=que.Option1;
Option5.Content = optin1;
RadioButton Option6 = Qpdatagrid.Columns[0].GetCellContent(que.Option2) as RadioButton;
RadioButton Option7 = Qpdatagrid.Columns[0].GetCellContent(que.Option3) as RadioButton;
RadioButton Option8 = Qpdatagrid.Columns[0].GetCellContent(que.Option4) as RadioButton;
}
nagaraju84 reputationPosted Aug 22, 2011, 8:01 PM EDT
Thanks
P.Nagaraju