V
Vikas Kumar
i had coded like this
<ItemTemplate>
<table width="100%">
<tr width="100%">
<td
width="25%"><%#DataBinder.Eval(Container.DataItem,"FName")%></td>
<td width="25%"><input type=text name="txtPass"
value='<%#DataBinder.Eval(Container.DataItem,"Passwd")%>'></td>
<td width="45%" align="left">
<asp:RadioButton ID="rb1" runat="server" GroupName="gp1"
/>
<asp:RadioButton ID="rb2" runat="server" GroupName="gp1"
/>
<asp:RadioButton ID="rb3" Runat="server" GroupName="gp1"
/>
</td>
<td width="5%" align="left">
<asp:Button ID="EditSubuser" Text="Edit"
Runat="server"></asp:Button></td>
</tr>
</table>
</ItemTemplate>
and in code behind
protected void listUser_ItemDataBound(object sender,
System.Web.UI.WebControls.DataListItemEventArgs e)
{
DataRowView drv = e.Item.DataItem as DataRowView;
RadioButton rb1 = (RadioButton)e.Item.FindControl("rb1");
RadioButton rb2 = (RadioButton)e.Item.FindControl("rb2");
RadioButton rb3=(RadioButton)e.Item.FindControl("rb3");
}
its working fine till here
but how will i select one of these three now
the code below selects 1,2 or 3 from permission colomn
how will i take value from permission coloumn and will set one of these
three rd1 or rd2 or rd3
string strsql="select
Userinfo.UID,Userinfo.FName,Userinfo.Permission,UserPassword.Passwd from
Userinfo,UserPassword where Userinfo.UID=UserPassword.UID and
Userinfo.ParentID="+ userid;
Database db=DatabaseFactory.CreateDatabase();
DBCommandWrapper cmd=db.GetSqlStringCommandWrapper(strsql);
dr=db.ExecuteReader(cmd);
listUser.DataSource=dr;
listUser.DataBind();
dr.Close();
<ItemTemplate>
<table width="100%">
<tr width="100%">
<td
width="25%"><%#DataBinder.Eval(Container.DataItem,"FName")%></td>
<td width="25%"><input type=text name="txtPass"
value='<%#DataBinder.Eval(Container.DataItem,"Passwd")%>'></td>
<td width="45%" align="left">
<asp:RadioButton ID="rb1" runat="server" GroupName="gp1"
/>
<asp:RadioButton ID="rb2" runat="server" GroupName="gp1"
/>
<asp:RadioButton ID="rb3" Runat="server" GroupName="gp1"
/>
</td>
<td width="5%" align="left">
<asp:Button ID="EditSubuser" Text="Edit"
Runat="server"></asp:Button></td>
</tr>
</table>
</ItemTemplate>
and in code behind
protected void listUser_ItemDataBound(object sender,
System.Web.UI.WebControls.DataListItemEventArgs e)
{
DataRowView drv = e.Item.DataItem as DataRowView;
RadioButton rb1 = (RadioButton)e.Item.FindControl("rb1");
RadioButton rb2 = (RadioButton)e.Item.FindControl("rb2");
RadioButton rb3=(RadioButton)e.Item.FindControl("rb3");
}
its working fine till here
but how will i select one of these three now
the code below selects 1,2 or 3 from permission colomn
how will i take value from permission coloumn and will set one of these
three rd1 or rd2 or rd3
string strsql="select
Userinfo.UID,Userinfo.FName,Userinfo.Permission,UserPassword.Passwd from
Userinfo,UserPassword where Userinfo.UID=UserPassword.UID and
Userinfo.ParentID="+ userid;
Database db=DatabaseFactory.CreateDatabase();
DBCommandWrapper cmd=db.GetSqlStringCommandWrapper(strsql);
dr=db.ExecuteReader(cmd);
listUser.DataSource=dr;
listUser.DataBind();
dr.Close();