473,395 Members | 1,969 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,395 software developers and data experts.

Access to a DataGrid in MultiPage from cs

Hello
I have a web form with MultiPage that contain DataGrid
My HTML code in the aspx page:
<iewc:multipage id="MP1" style="Z-INDEX: 101; LEFT: 225px;
POSITION: . . ."/>
iewc:PageView id="processData1/"> asp:DataGrid id="DG2" style="Z-INDEX: 110; LEFT: 699px;

POSITION: absolute; TOP: 379px" unat="server">
</asp:DataGrid<
</iewc:PageView>
</iewc:multipage>
In the full HTML code I have more then one PageVive and
more then one DataGrid.
In my C# code I'm trying to fill the DataGrid in data from
the DB.

The C# code:
SqlConnection conn = new SqlConnection(. . .);
SqlCommand query = new SqlCommand("");
query = new SqlCommand("select . . .",conn);
conn.Open();
SqlDataReader dr;
dr = query.ExecuteReader();
DG2.DataSource = dr; א Error DG2 not recognize
DG2.DataBind(); א Error DG2 not recognize
dr.Close();
conn.Close();

How can I have access to the DataGrid that is defined in
the HTML from the cs file?
Thank you very much!!!

Nov 16 '05 #1
2 1523
Hi
May be there is more to the problem that wasn't clear , I see that you do
access the datagrid already
When you create such object in the html , an object with the ID , in your
case DG2 , would be created in your page class. Thy the this keyword
inside your c# code then the dot operator you would find the datagrid
object with the name DG2 ( however , you posted code already shows that
you are using that ) . if you are using multiple dataGrid , then you would
have as many in your cs file all match the IDs in the HTML
Hope that helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
hi there,

the problem might be in
asp:DataGrid id="DG2" style="Z-INDEX: 110; LEFT: 699px; POSITION: absolute; TOP: 379px" unat="server">

you have there unat="server"
it should be runat

hope this helps you
"T.H.M" <an*******@discussions.microsoft.com> wrote in message news:<12****************************@phx.gbl>... Hello
I have a web form with MultiPage that contain DataGrid
My HTML code in the aspx page:
<iewc:multipage id="MP1" style="Z-INDEX: 101; LEFT: 225px;
POSITION: . . ."/>
>iewc:PageView id="processData1/">
asp:DataGrid id="DG2" style="Z-INDEX: 110; LEFT: 699px;

POSITION: absolute; TOP: 379px" unat="server">
</asp:DataGrid<
</iewc:PageView>
</iewc:multipage>
In the full HTML code I have more then one PageVive and
more then one DataGrid.
In my C# code I'm trying to fill the DataGrid in data from
the DB.

The C# code:
SqlConnection conn = new SqlConnection(. . .);
SqlCommand query = new SqlCommand("");
query = new SqlCommand("select . . .",conn);
conn.Open();
SqlDataReader dr;
dr = query.ExecuteReader();
DG2.DataSource = dr; א Error DG2 not recognize
DG2.DataBind(); א Error DG2 not recognize
dr.Close();
conn.Close();

How can I have access to the DataGrid that is defined in
the HTML from the cs file?
Thank you very much!!!

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: news.microsoft.com | last post by:
Hello group, My goal is to attach an image over another image. Top image should be transparent so the back image is visible through the top one. Bellow is a test code in VB.NET. You need to...
0
by: T.H.M | last post by:
Hello I have a web form with MultiPage that contain DataGrid My HTML code in the aspx page: <iewc:multipage id="MP1" style="Z-INDEX: 101; LEFT: 225px; POSITION: . . ."/> >iewc:PageView...
1
by: szabelin | last post by:
Is it possible to dynamically add a PageView to MultiPage? TabStrip has items property, so Tab and TabSeparator can be added... how about adding PageView to MultiPage? If not possible please...
0
by: Curtis Hatter | last post by:
I apologize if this has been answered, but on the .NET 247 site I saw a thread titled "Datagrid's ItemCommand Event", and had similar troubles with the Datagrid not properly firing the delete event...
0
by: mehul | last post by:
CheckBox template always evaluate to False even if checked in a DataGrid hosted inside a TabStrip in ASP.NET Hi, I am trying to develop an ASP.NET application. I am using TabStrip (which is...
0
by: RedEagle | last post by:
Hi, I don't know if you worked that out, but I have found a great workaround, inside EVERY PageView I put a Panel (just one or more panel for each PageView, it depends on how complicated is your...
0
by: The Eeediot | last post by:
I've got a silly question for the group. I have an DataGrid that displays its information inside a panel... Well, actually it's a MultiPage object. I have a boader around the MultiPage object but...
1
by: Ira | last post by:
I was successful in creating the multipage Tif files in VB.net using the following the following code: Public Sub SaveSeveralOnePageFilesInADir(ByVal DrNm As String, ByVal resultFl As String)...
4
by: shaiful | last post by:
Hi. I have a simple problem with multipage. I placed Multipage control on my form, but there are only 2 pages in multipage control by default. I would like to increase more pages with multipage...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.