Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've Created user Defined GridView(i.e. Control Using .ascx)
I'm Using this Gridview Control on .aspx
but I'm not able To Find Gridview.Datasource property in my .aspx.cs

I Can Find GridView.DataBind() in .aspx.cs
Please Help...!
Posted
Updated 28-Jul-14 0:13am
v2

1 solution

That is...
C#
Gridview.DataSource

not...
C#
Gridview.Datasource


Mark the casing.
 
Share this answer
 
Comments
prashantttt 28-Jul-14 7:56am    
sorry that was typo mistake I meant .DataSource property only.....

when we type Property we get suggestions in those suggestions .DataSource is not present
Manually write and build. What you see?
prashantttt 29-Jul-14 3:16am    
I tried writing it manually but it gives error that Gridview(User Control) Does not contain Definition for DataSource....
then today I found dis link and Tried this link

[^]


but whenever it comes to The Method BindMyGrid in .ascx.cs It Gives NullReference i.e. Gridview is Null
Okay, I am confused now. Please answer me the following...

1. Where is the GridView declared? In aspx or ascx?
2. Where you are accessing the GridView.DataSource? In aspx.cs or ascx.cs?
prashantttt 29-Jul-14 7:43am    
1.Gridview is Declared in .ascx.cs

2.I'm Accessing Gridview.DataSource in ascx.cs

I've DataTable in aspx.cs which I'm Trying to Bind to the GridView(which is present in .ascx.cs)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900