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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
nagarajuPosted Aug 23, 2011, 12:01 AM
Thanks
P.Nagaraju
nagarajuPosted Aug 22, 2011, 11:57 PM
{
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;
}
Mahadesh MahalingappaPosted Aug 22, 2011, 2:16 PM
nagarajuPosted Aug 22, 2011, 2:08 AM
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
Priya LingePosted Aug 22, 2011, 1:35 AM
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.