Hi There,
I would like to declare a WebDialogWindow and open it in my code behind page to show a message when something is wrong. How would I do that.
Thanks for the help.
Best Regards,
Steve.
Hello Steve,
Please refer to this topic for more information on how to open a WebDialogWindow from the code-behind. If you want to declare it also in the code-behind instead of using the designer, you can use the same topic to get the important property names (they are hyperlinked).
To show the dialog window from the code behind:
this.WebDialogWindow1.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal;
Elizabeth AlbertLocalization Engineer
Hi Elizabeth,
Thanks for your reply but that did not work. The webDialog did not show.My page has various divs and I was wondering whether the webdialog has to be declared in a certain place so that the call from codebehind can show it.
I am trying to show the webdialog when a selectedindexchange on a dropdown is triggered. I have debugged and stepped through the code and the dialogwindowstate.normal is definately being called.
Thank you for the clarification regarding the scenario.
By default the SelectionChanged event is asynchronous.
You should set the AutoPostBackFlags regarding this event to be turned on , because full postback is needed in order to change the state of the WebDialogWindow.
Please refer to the sample code snippet below:
<ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px" OnSelectionChanged="WebDropDown1_SelectionChanged">
<AutoPostBackFlags SelectionChanged="On" />
<Items>
<ig:DropDownItem Selected="False" Text="RightOption" Value="">
</ig:DropDownItem>
<ig:DropDownItem Selected="False" Text="WrongOption" Value="">
</Items>
</ig:WebDropDown>
<ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="300px" Width="400px"
WindowState="Hidden">
</ig:WebDialogWindow>
protected void WebDropDown1_SelectionChanged(object sender, Infragistics.Web.UI.ListControls.DropDownSelectionChangedEventArgs e)
{
int newSelectedItem = (int) e.NewSelection;
if (WebDropDown1.Items[newSelectedItem].Text.Equals("WrongOption")) {
WebDialogWindow1.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal;
}
Let us know if you need further assistance regarding this.