On a website I am working on, we have a WebGroupBox and two WebImageButtons, Search and Reset. For some reason, when you enter in text in a text box and hit enter to do the search, it doesn't hit the search method, it now appears to be just refreshing the page and keeping the text you entered in the text box. Is this functionality different than a regular form/panel? I tried to wrap the text boxes in a panel but default button doesn't seem to work with WebImageButtons.
Hi Justin,
I tried to test WebGroupBox which had TextBox, 2 WebImageButtons, and few other buttons located before and after WebGroupBox. If Form.DefaultButton was not set, then the Enter key triggered postback for the very first/top asp:Button or WebImageButton located on page. If Form.DefaultButton was set, then Enter key triggered postback for asp:Button or WebImageButton defined by value of DefaultButton. If that what you expected, then I am not sure why it did not work for you.Note: if you use very old version of Infragistics.WebUI, then it is possible that DefaultButton will not work for WebImageButton, because it did not implemented IButtonControl interface. In this case you should upgrade NetAdvantage for more recent version.Also WebGroupBox groups children only visually, but not by functionality.Below are codes which I tested.
aspx:<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /><igmisc:WebGroupBox ID="WebGroupBox1" runat="server" Text="Webgrb" TitleAlignment="Left"> <Template> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <igtxt:WebImageButton ID="WebImageButton1" runat="server" Text="Search" onclick="WebImageButton1_Click"> </igtxt:WebImageButton> <igtxt:WebImageButton ID="WebImageButton2" runat="server" Text="Reset" onclick="WebImageButton2_Click"> </igtxt:WebImageButton> </Template></igmisc:WebGroupBox>aspx.cs:protected void Page_Load(object sender, EventArgs e){ this.Button1.Text += "0"; this.Form.DefaultButton = this.WebImageButton1.UniqueID;}
protected void WebImageButton1_Click(object sender, Infragistics.WebUI.WebDataInput.ButtonEventArgs e){ this.Button1.Text += "1";}protected void WebImageButton2_Click(object sender, Infragistics.WebUI.WebDataInput.ButtonEventArgs e){ this.Button1.Text += "2";}protected void Button1_Click(object sender, EventArgs e){ this.Button1.Text += "3";}If those codes are wrong, then please attach a simple aspx (within OPTIONS tab) which can be used to test that scenario.