473,385 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

GridView selection and binding

Hi all,

I've got a GridView for which I need to populate the rows with something a little more complicated than a simple SQL statement, thus the SelectCommand won't work. What I'd like to do is call an external procedure (I assume via OnSelecting) to do my more complicated query, but how do I get the results to bind to the GridView object?

Thanks for any information.

Robert
Apr 21 '08 #1
2 910
Plater
7,872 Expert 4TB
What do you mean by external procedure?

If you create a function and have it return a DataTable object (or DataSet) you can just set it as the .DataSource on your GridView and then call the .DataBind() function.
Apr 21 '08 #2
Ah! Yes, that makes sense. And yes "external procedure" refers to the C# code called using the OnSelecting call. I wanted to use this call to do the query to populate my GridView object, but I couldn't figure out how to get the results from my C# code to populate the GridView. Your answer is quite helpful.

Thanks. I'm still learning.

Robert
Apr 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: mateo | last post by:
Hello, I have a GridView inside which i want to show 3 dropdownList (one for each Column). So i've created 3 TemplateField Continent Country City
3
by: Thirsty Traveler | last post by:
I have a gridview where the datasource is bound after a selection. The result of doing this is that sorting and paging do not work. I was given a sample of how to resolve this, however my attempt...
5
by: GaryDean | last post by:
I have a GridView that works fine when I bind it to an ObjectDataSource at design time. But if I bind it at run time nothing happens. On a button click event I say... GridView1.DataSourceID =...
2
by: ami | last post by:
In my code, I need to implement x numbers of Gridviews dynamically based on user selection. Because I am unaware of the number of gridviews, this is done after the user enters input. I need to...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
0
by: ABHIJIT B | last post by:
Hi, I am using GridView in my web page.In that form after clicking Add button I am again binding GridView with newly added record. The problem I am facing is how to highlight newly inserted...
2
by: RobertTheProgrammer | last post by:
Hi again, Okay, I decided the GridView is the way to go to solve my problem. But now I've got another problem. I've found plenty of examples about how to add a DropDownList item to the grid...
1
by: taa | last post by:
protected void LoadExercises(object sender, EventArgs e) { // Navn, (Beskrivelse), Type, Exid, Target var exercises = from ex in context.Exercises select new {exerciseId = ex.ExerciseId,...
3
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a gridview with several template columns and a few command button columns, column 1 and 2 are dropdown boxes, column 3 is a checkbox and column 4 is a text box, followed by command button...
0
by: pavanip | last post by:
Hi, I am facing problem with combobox in gridview.I have used combobox in gridview and i am binding data to gridview combobox from database. If i click 2 times on combobox then it is showing the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.