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

Adding Custom DataGrid Class to Form

HKM
Hello !
I have extended DataGrid Control as per my requirements. My questions
is how to add this Custom Data Grid to the Form (that I want this
customized grid to appear). Following are the blocks of code.

public class CustomDataGrid : DataGrid
{
public CustomDataGrid()
{
// Customizations
}
public int CountSelectedColumn()
{
// sample customized method.
}
}

Now the form that im trying to use the above mentioned CustomDataGrid
control is a seperate class. I dont understand how to add this
CustomDataGrid component visually (drag n drop or if there is any
other way) to the form so that it can render my data.
Thanks in advance,
-HKM
Nov 15 '05 #1
2 1990
Go to the Toolbox window in VS.NET. Assuming this a WinForm component, right
click on "Windows Forms" and select "Add/Remove Items..."

Click the "Browse..." button, and find the DLL with your grid (I'm assuming
it's in its own .DLL). Click "Open" and then go through the listbox and find
your component and make sure it's checked. Now it will be in the Window
Forms section of the Toolbox and you can simply drag it to your form.

Optionally, you can simply drag a regular DataGrid to your form and then go
in and change the data type in the code to your own DataGrid and go from
there.

Pete

"HKM" <hk****@yahoo.com> wrote in message
news:44**************************@posting.google.c om...
Hello !
I have extended DataGrid Control as per my requirements. My questions
is how to add this Custom Data Grid to the Form (that I want this
customized grid to appear). Following are the blocks of code.

public class CustomDataGrid : DataGrid
{
public CustomDataGrid()
{
// Customizations
}
public int CountSelectedColumn()
{
// sample customized method.
}
}

Now the form that im trying to use the above mentioned CustomDataGrid
control is a seperate class. I dont understand how to add this
CustomDataGrid component visually (drag n drop or if there is any
other way) to the form so that it can render my data.
Thanks in advance,
-HKM

Nov 15 '05 #2
HKM
Got it !

It worked, I built the seperate assembly for it and was able to add it
to the toolbar.

Thanks,
-HKM

"Pete Davis" <pd******@hotmail.com> wrote in message news:<ef******************************@news.megane tnews.com>...
Go to the Toolbox window in VS.NET. Assuming this a WinForm component, right
click on "Windows Forms" and select "Add/Remove Items..."

Click the "Browse..." button, and find the DLL with your grid (I'm assuming
it's in its own .DLL). Click "Open" and then go through the listbox and find
your component and make sure it's checked. Now it will be in the Window
Forms section of the Toolbox and you can simply drag it to your form.

Optionally, you can simply drag a regular DataGrid to your form and then go
in and change the data type in the code to your own DataGrid and go from
there.

Pete

"HKM" <hk****@yahoo.com> wrote in message
news:44**************************@posting.google.c om...
Hello !
I have extended DataGrid Control as per my requirements. My questions
is how to add this Custom Data Grid to the Form (that I want this
customized grid to appear). Following are the blocks of code.

public class CustomDataGrid : DataGrid
{
public CustomDataGrid()
{
// Customizations
}
public int CountSelectedColumn()
{
// sample customized method.
}
}

Now the form that im trying to use the above mentioned CustomDataGrid
control is a seperate class. I dont understand how to add this
CustomDataGrid component visually (drag n drop or if there is any
other way) to the form so that it can render my data.
Thanks in advance,
-HKM

Nov 15 '05 #3

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

Similar topics

2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
1
by: Vagabond Software | last post by:
I am creating a custom datagrid based, in part, from someone else's code. The author declared a derived datagrid class in a windows form, then declared a derived ColumnStyle class, in the same form,...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
7
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid,...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
3
by: Fao, Sean | last post by:
I have a DataGrid that I'm adding CheckBox controls to at runtime (in the code behind) and I'm not sure if I'm doing it correctly. First of all, I noticed that the MyDataGrid.Columns.Add() method...
1
by: viktor9990 | last post by:
I'm trying to bind a custom collection to an autogenerated datagrid without success. I'm getting this error: DataGrid with id 'DataGrid2' could not automatically generate any columns from 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...
1
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
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...

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.