473,326 Members | 2,095 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,326 software developers and data experts.

Datagrid - where to initialize?

Hi there,

I derived a custom grid class from Forms.DataGrid to serve as a logging table. Currently I'm adding the columns in the grid's constructor. What I would like to have is a class that does this automatically when the grid is initialized. Then the columns would be added between to BeginInit and EndInit methods of the grid's ISupportInitialize interface. But I don't know what event to bind to or what to override.

Can someone help me out? Thanks,
---
Tom Tempelaere.
Nov 16 '05 #1
2 2348
Hi myself & others

----- TT (Tom Tempelaere) wrote: ----
I get the feeling that "Forms.Datagrid" is one of the most complex classes in .NET otherwise I would probably have >had an answer already. Anyway, ..
No kidding.
I searched again and I haven't found a good event to bind to similar to the "Load" event for a form, and I haven't >found a method I can override to do initialization stuff (setup the right columns etc). Can anyone give a clue as to what I >should do? Or perhaps a link to a site that explains how ..
Blablabla.
Another issue is that now, since I derived from Datagrid, I cannot see the grid in designer mode :'(. I remove any auto->generated code for a Datagrid I added to the form and place the initialization somewhere else (the code-generator >removes code in InitializeComponent methods). But now the grid is no longer drawn on the form ... pitty. So how can I >keep the grid drawn on the form??? Please help me I'm stuck on this


Well no longer I am. I kept the initialization stuff in the constructor of my DataGrid derived class and added the control to the toolbox (by referring the assembly that defines it). Damn, that was EZ! :

Tom T.
Nov 16 '05 #2
Hi, can you elaborate a little more on how you referenced the assembly to show the control in design mode? I am curious about this as well

(sry I do not know froms.datagrid enough

Thanks!
Nov 16 '05 #3

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

Similar topics

3
by: Ruy Castelli | last post by:
Hello, I'm trying to get the details out of a datagrid component and it works fine when I'm accessing the first page of the datagrid, but when I try to click on the details hyperlink for an item...
12
by: James Norton-Jones | last post by:
Hi, Am I trying to hold the data of a DataGrid in a label so that when the form is reposted the DataGrid can be repopulated. The problem I am having is that I don't understand how to get the...
0
by: Chad Folden | last post by:
I can't figure out how to use the EditCommand for the nested datagrid .. HELP PLEASE ;-) It works perfectly for the parent datagrid, but will not display, even though the EditCommand event is...
7
by: localhost | last post by:
A DataGrid with shows a label in one of the columns when in view mode. When in edit mode, I want to show a dropdown, and have the default selection set to what the textbox used to be. Right now...
2
by: Roy | last post by:
I am very, very new to ASP.NEt and have never done ASP. I have been trying to get a datagrid to work for about 5 days with very limited results. When I use property builder, bind the control, set...
7
by: DC Gringo | last post by:
I have a datagrid that won't sort. The event handler is firing and return label text, just not the sort. Here's my Sub Page_Load and Sub DataGrid1_SortCommand: -------------------- Private...
2
by: naija naija | last post by:
Hello guys i made a Datagrid with Editing,Update and Cancel using VS.NET. to my surprise nothing is on the screen after compilation .. By code below:- Imports System.Data Imports...
2
by: AA | last post by:
Do anyone know how to refresh the datagrid without setting datasource to nothing and initialize the grid again? My case is that I have form consisting from two part. The upper part is a datagrid...
0
by: hanusoft | last post by:
This is an example of editing in DataGrid and Default Paging http://www.hanusoftware.com Html Design Code : - <asp:DataGrid id="DataGrid1" DataKeyField="id" runat="server" Height="224px"...
1
by: abellix | last post by:
An updatepanel contains a datagrid, this datagrid has columns generated by code-behind: some columns should have async postback, others should have sync postback. Here a sample to reproduce the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.