473,779 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:multipa ge id="MP1" style="Z-INDEX: 101; LEFT: 225px;
POSITION: . . ."/>
iewc:PageVie w id="processData 1/"> 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("sel ect . . .",conn);
conn.Open();
SqlDataReader dr;
dr = query.ExecuteRe ader();
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 1538
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*******@disc ussions.microso ft.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:multipa ge id="MP1" style="Z-INDEX: 101; LEFT: 225px;
POSITION: . . ."/>
>iewc:PageVie w id="processData 1/">
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("sel ect . . .",conn);
conn.Open();
SqlDataReader dr;
dr = query.ExecuteRe ader();
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
2423
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 create a form, a button (Button1) and an Picture Box (picBox). "watermark.jpg" is any jpg image, "beispiel.tif" is a multipage TIFF image with the white background, which will turn to transparent. The most important thing here is that the TIFF image...
0
1171
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 id="processData1/"> >asp:DataGrid id="DG2" style="Z-INDEX: 110; LEFT: 699px; POSITION: absolute; TOP: 379px" unat="server"> </asp:DataGrid<
1
1550
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 recommend another client-side tab control. Thank you
0
317
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 if using a push button. I could not find the thread here, so I'm posting my finding's here in hopes that it will help others that are having the same problem. The problem: In a DataGrid the "Delete" command does not fire properly from a...
0
1858
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 part of IE WebControls). Inside a tab I have a datagrid defined as follows:
0
1355
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 front-end interface). Doing this way, the datagrid works just fine. Andy
0
1063
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 when the DataGrid extends past the width of the web browser the top boarder ends at the edge of the browser window. How can I get to boarder to completely surround the DataGrid and make it look nicer? TIA...
1
4893
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) Dim pages As Bitmap = Nothing Dim PgCnt As Integer
4
2309
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 option. I tried to set Multipage1.value = 3, but it says Error. I am using vb 6.0. So what is the process or method? Could you please help me to give idea about this small problem? Thanks in advance, Shaiful
0
9471
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10302
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10071
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7478
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.