I have a Grid view and I want to use Two different Sql DataSources on Selecting different values from DropDownList i.e. On Selected Index Change.
Please help me How should I implement that???
I don't want to use Code behind to change the Data in Gridview....
Thanks in Advance
Without using code behind you cannot implement in this process so it is not possible
Related
I have a query. I want to show a particular column data from a table in form of links. Suppose 5 rows and there in that column, I want to show 5 buttons or links.
Now I know how to bind in gridview or dropdown. But I'm totally unsure about this.
Any ideas will greatly help me.
Hi basically you have two options that you can implement in many ways.
Set the data in the view model in your case create a property that display a collection of items based on the right column
In the view (ex: wpf) create a data template that display the row according the column
what I'm trying to do is export the selected rows to Excel.
But if I use the SelectedItems property it gives me a collection of the selected rows but in the order that they were selected.
I don't want this.
I want to get a collection of the selected rows as they appear in my table (however they are sorted).
Is there a way to do this?
Do i nedd to get all the data from my table and check each row if it's selected or not and then do what I need?
(it's part of a very large system and i just started working on this. i've never heard of this component before and i don't know all of it's properties and yes, i have looked on MSDN and in the definition)
Any help is appreciated
Cheers
I solved this problem using the Sort() function.
GridEX.SelectedItems.Sort();
Suppose i have many dropdownlist in my aspx page and every dropdownlist is connected to database.
So what approach that i uses for the page_load.
Any Suggestion?
I am using ASP.Net C# with SQL Server 2008.
Depending on your requirements, I can think of different ways to improve the page load performance
If values in your dropdownlists do not matter on the initial page state, you can defer binding of the controls
If there are a lot items in each dropdownlist you can make use of autocomplete or load-on-demand
Output Cache
On the data side, you can use sqlcachedependency for data that do not change that often
If dropdownlists does not depends on other dropdownlists selected value then Best way as per my suggestion is that you create One stored procedure with All select querys for binding dropdownlist and from codebehind fill it into dataset then bind datatable in dataset to appropriate dropdownlist.
Its just my suggestion because as per what i know is store procedure are faster and in this way you only need to call one store procedure.
I have a gridview and sqldatasource.
I want to display in a label, the number of rows from the gridview which contains a certain value in one of the columns (in the form_load event)
I thought about looping through all columns of the gridview but it will take a lot of time for this and maybe there's another way of doing this.
Can someone help me finding the "other way"?
Thanks,
Best solution would be to let the database handle filtering - you'll get much better performance that way than looping over the data on application server.
Perhaps create another SqlDataSource with an SQL statement containing appropriate WHERE condition and bind it to your label?
I have two dropdownlist on my webpage i want to fill both of that dropdownlist with a single code written in a separate class file. i want to pass the table name with field name and want to get that data into my used dropdownlist.
my code is as follows
ddl1 = obj.Method("table_Name");
now the following function return the dropdownlist
public dropdownlist Method(string table_NAME)
{
// code
return dropdownlist_1;
}
now i want to use this code for filling multiple dropdownlist, by using this i can reduce my code. same code will be use to fill other dropdownlists also.
Please help me as soon as possible.............
Thanks in advance.
Please view if ObjectDataProvider is the class you are looking for. Here is the reference:
http://msdn.microsoft.com/en-us/library/system.windows.data.objectdataprovider.aspx
You would need a server side scripting language (such as PHP, Perl, JSP, ASP, Python, and many more). Once you have a language selected, the code for that should be relatively easy. The basic algorithm would be:
Issue an database request to get the data to fill in
Iterate over your results and generate a form option from each one
Concatenate the form options to one another
Insert the resulting menu into your page