I have a table with a search bar above it. The content of the search bar filters the query for the table. I want the data in the table to be reloaded each time the user inputs a letter.
If I set the onValueEdit event to Reload the Datasource, it reloads the data just right, but if I set the onInputChange event to do the reloading, it reloads the table without filtering the query, displaying all of the records. No matter what I type in, it does not filter at all (altough it does seem to reload the datasource), unless I hit enter, fireing the onValueEdit event, when it does the filtering. Any ideas why can't I filter the query with the onInputChange event?
Thank you in advance!
The onInputChange event does not appear to support the value binding of a particular widget. Whether this is a bug or the intended behavior is unknown. There are two options to circumvent this behavior however and they are as follows:
Change your code in the onInputChange event to:
Option 1:
widget.value = widget.value;
widget.datasource.load();
Option 2:
widget.value = event.target.value;
widget.datasource.load();
Related
I am trying to get the value of the label to change each time a new date is selected. What is the best way to do this?
I have tried using page load and page init function to set it after each action as I thought the page would refresh automatically but having no luck. I am probably going down wrong path with that approach.
Any suggestions much appreciated.
If you want the page to refresh which will make it call the page load function again then you will need to set the AutoPostBack attribute of the calendar picker to True.
Or on the SelectionChanged event in the code behind of the calendar you can say
lblA.Text = calendar.SelectedDate
I have a page which is having the following
Some ddl's for Filter the data
A Submit button
A export Button
A GridView
In general We show/hide Export button if submit query results more than zero rows/ no rows
NOTE:
It is not only the case for one button but there would be more and i will have to check for the permission for every where i show /hide the buttons
For Example
Page_Load
showHideAsPerPermission(btnExport);
BtnSubmitClick()
if rows>0
btnExport.Visible = true;
else
btnExport.Visible = false;
But for the purpose of Permission
I want to set Export button visibility to true/false after BtnSubmit_click (or all controls events like selected index change, textChanged etc.) event has fired
A little Explanation of my problem
Say if you have permission to export then it only visible when rows>0 and if you don't have then it invisible even rows>0 but if i set the permission on page load and then i set exports visibility true for rows > 0 then it is visible even you don't have permission so is there any event which fires after control events
Is there any method which i can utilize for this purpose
I have read the following events and tried Page_Unload event which actually does nothing cause page is already rendered
So is there any method which could accomplish my task
Note:
As per my Knowledge there is no such Event so can i create a custom page event?
Just do it in Page_Load.
Keep in mind, on BtnSubmit_click, the page will post back, Page_Load is going to execute again (so you'll probably need something like if (!IsPostback)...), and then BtnSubmit_click.
I would like to perform a postback when the droplistlist selected value changes, but only if it was changed via expanding the downdown and clicking an option, not is the user tabs to the control and uses the arrow keys. The reason for this is simple, keyboard accessibility.
Postbacks are triggered using __doPostBack('uniqueidofcontrol', 'commandname'); so when the list changes value (I believe in onchange event), it posts to the server. You would need to not set autopostback. What you would need to do is tap into the click event (if there is one) and then call __doPostBack(..) method upon that event.
HTH.
I search for results, click one, it opens in a new window, then edit it, and close the popup.
Then I hit 'search' to refresh my gridview, but the changes do not reflect unless I hit F5. It's caching it and I need to stop it, but I don't know how. IdeaS?
Are you rebinding the grid when the user clicks 'search'? You need to be sure that somewhere in the 'search' method control flow, you're doing this:
dataGrid.DataSource = updatedDataSource;
dataGrid.DataBind();
I'm guessing you're binding your results to the grid during PageLoad. Because the event handler for your search button gets fired after PageLoad, the new search results don't get bound to the grid until the next page request. If this is the problem you'll need to rebind the grid when handling the search button event.
I have a DropDownList on an ASP.NET master page and I want to change some values and refresh the page when I select a different item from the list. I enabled the post back property in the DropDownList but it still gets back always to the first value whenever I select. Any advice?
Please post some more code to show where you are setting the value of the dropdown (both on load and anywhere else).
Usually, this is just a case of not understanding the event model. Try setting breakpoints on all of those points where you set the value and step through the code.
The most obvious case would be if you're setting the value in the page_load event handler and not wrapping it in a check for !Page.IsPostback