hello, I have an error on my page and I cant figure out why this behavior occurs.
The status is: on my webpage I have 3 Webdropdowns and 1 Webimagebutton as you can see in this picture. On the page is also a webdatagrid below the shown row.
changing one of the first two dropdowns causes that the file of the newly selected week is loaded an displayed in the webdatagrid. If this file is empty or not available the webdatagrid is empty. On the first load of the page, the first two dropdowns are set to the actual week number of the actual year and if there is a datafile for this week the file is loaded. The third dropdown is set to the week number of the last week. These settings are set in the Page_PreLoad event.
Now the problem: regardless whether the wdg is empty or not, or if someone selects a week in the third dropdown or not the import button does not fire the btnImport_Click function at all. But if the user selects an other week with e.g. one of the first two dropdowns, that week is loaded into the datagrid and now the button fires the event and the selected week is imported.
The definition of the event for the "import" button is:
Protected Sub btnImport_Click(ByVal sender As Object, ByVal e As Infragistics.WebUI.WebDataInput.ButtonEventArgs) Handles btnImport.Click ...
Protected Sub btnImport_Click(ByVal sender As Object, ByVal e As Infragistics.WebUI.WebDataInput.ButtonEventArgs) Handles btnImport.Click
...
It seems that with the initial loading of the website not all functions are loaded and loading an other week corrects this. I have tested this with IE 8 and Firefox 5.0.
Has anybody a hint what may be wrong?
I'm using now NA Version 11.1.20111.2020.
Thanks in advance
Hello Martin,
Thank you for posting in our forums.
I tried to replicate the issue but with no avail.
Can you please provide us with simple code snippet reproducing the issue?
Also I recommend you moving the settings from Page_PreLoad event to Page_Init event.
Hope hearing from you.
Hello Tsvetelina,
thank you for your answer. Ok. I'll try to move the settings. But you asked for an example. I have done an example of the page. If you open the page the actual week is selected and the screen will be empty because there is no file for this week at this moment. Please try to import data from week 25. You will find that the import button does not fire the event. But after you have tried to load another week the button will work as expected.
Kind regards
Martin
Thank you for the sample and the steps to reproduce.
I recommend you setting
<AutoPostBackFlags SelectionChanged="On" />
<div class="left120">
<ig:WebDropDown ID="DDimportWeek" runat="server" DataKeyFields="wkName" DataSourceID="ods4"
TextField="wkName" ValueField="wkName" Width="100px" >
<DropDownItemBinding TextField="wkName" ValueField="wkName" />
</ig:WebDropDown>
</div>
of the DDimportWeek WebDropDown
Hope this helps
Thank you for the answer. I tried what you recommended. Yes, it works. But only if the user has changed the dropdown!
Am I right in assuming that this recommendation is only a workaround? I can not understand why the button is not working directly after loading the page. The dropdown is prepared to show that the last week is already selected and the user has only to click the button. I think it would be fine if someone can solve this problem. Also I think I'm not the only one who has this problem.
Nonetheless thanks for this.Kind regardsMartin
Thank you for the update.
Yes, the issue happens because of the Validators that you are using.
They stop the button to do a post back.
The same situation will happen if you use a simple ASP button.
In order to avoid this you should set CausesValidation = false
<igtxt:WebImageButton ID="btnImport" runat="server" Text="import" Overflow="WordWrap"
CausesValidation="false" >
</igtxt:WebImageButton>
Let us know if you have further questions.
i have the same problem after postback my infragistics WebImageButton becomes disabled, but i'm using standard asp DropDownList.
Could you help me on this?
Thanks,
Eugen.