How can i set ASPxNavBar groups control
I have a ASPxNavBar control in my project. It has some NavBarGroup which has contenttemplate.
开发者_StackOverflow中文版 Hasta Tc Kimlik No: Ad:
</dx:ASPxTextBox>
</td>
</tr>
<tr>
<td>
Soyad:
</td>
<td>
<dx:ASPxTextBox ID="txtHastaSoyad" runat="server" Width="170px">
</dx:ASPxTextBox>
</td>
</tr>
</table>
</ContentTemplate>
</dx:NavBarGroup>
......................
I want to get NavBarGroup and set its control's value.
Hasta hasta = new Hasta(Session["hasta_id"].To<int>());
NavBarGroup hastaGrup = nbDiyalizBildirim.Groups.FindByName("hasta");
((ASPxTextBox)hastaGrup.FindControl("txtHastaTCkimlikNo")).Text = hasta.M_TcKimlikNo;
((ASPxTextBox)hastaGrup.FindControl("txtHastaAd")).Text = hasta.M_Adi;
((ASPxTextBox)hastaGrup.FindControl("txtHastaSoyad")).Text = hasta.M_Soyadi;
How can i set their values?
Thanks in advance.
The following code works fine here:
protected void ASPxNavBar1_PreRender(object sender, EventArgs e) {
ASPxNavBar navBar = sender as ASPxNavBar;
ASPxTextBox txtBox = navBar.Groups[0].FindControl("txtBox") as ASPxTextBox;
txtBox.Text = "some test string";
}
Here is the aspx markup:
<dx:ASPxNavBar ID="ASPxNavBar1" runat="server" OnPreRender="ASPxNavBar1_PreRender">
<Groups>
<dx:NavBarGroup>
<ContentTemplate>
<dx:ASPxTextBox ID="txtBox" runat="server"></dx:ASPxTextBox>
</ContentTemplate>
</dx:NavBarGroup>
</Groups>
</dx:ASPxNavBar>
精彩评论