heboh
asked on
adding panels to a datagrid column.
does anyone know how i can add panels on a datagrid column. typically, the panels would contain a bunch of controls... i have tried to implement one by adding the DataGridColumnStyle but, the best i can do is to get it to display, only during edit mode. if i put the displaying part on the paint method, it will flicker..
does anyone have a solution to get a panel (containing a few controls on the panel) to be displayed on a datagrid column, all the time, and can be access during normal or edit mode.
thanks.
does anyone have a solution to get a panel (containing a few controls on the panel) to be displayed on a datagrid column, all the time, and can be access during normal or edit mode.
thanks.
ASKER
TheAvenger? is this possible?
The only think I can think of is to inherit from DataGridColumnStyle but I think you already tried this (based on your explanation). As a matter of fact I never dealt with showing the contents in a different way in a data grid.
Have a look at this example:
http://www.codeproject.com/cs/miscctrl/csharpgridcontrol.asp
They have buttons in the data grid that are shown all the time. Also some other controls. So what you have to do is change this with your control. However I think they wrote a lot of code, so you will have to go through it and get the idea. Maybe you will also have to fix a couple of things... I hope it helps at least a little bit.
Have a look at this example:
http://www.codeproject.com/cs/miscctrl/csharpgridcontrol.asp
They have buttons in the data grid that are shown all the time. Also some other controls. So what you have to do is change this with your control. However I think they wrote a lot of code, so you will have to go through it and get the idea. Maybe you will also have to fix a couple of things... I hope it helps at least a little bit.
ASKER
hi TheAvenger,
thanks for your help.. but the grid control available at the code project, does not inherit from datagrid. it is itself an indepedent component.
but, i just have a couple of question that might help me.. if i extend the datagrid component itself, do you know how I can force the data grid to create separate control instances that resides in each column row.
currently, i think the datagrid, creates an instance of for example a textbox control only once for each column, and share it among all rows of that column. but what i want is to possibly create a separate instance of that textbox, for each row in the column.
and another thing is, my current implementation of the component, is that it extends the DataGridColumnStyle, and placed a panel in a similar way to a number of samples on the code project which inserts combo boxes. The problem is that, the panel only appears when the state of the cell is in edit mode. do you know how I can force the panel or what ever control on the column to always appear.. ?
thanks kindly for your help...
thanks for your help.. but the grid control available at the code project, does not inherit from datagrid. it is itself an indepedent component.
but, i just have a couple of question that might help me.. if i extend the datagrid component itself, do you know how I can force the data grid to create separate control instances that resides in each column row.
currently, i think the datagrid, creates an instance of for example a textbox control only once for each column, and share it among all rows of that column. but what i want is to possibly create a separate instance of that textbox, for each row in the column.
and another thing is, my current implementation of the component, is that it extends the DataGridColumnStyle, and placed a panel in a similar way to a number of samples on the code project which inserts combo boxes. The problem is that, the panel only appears when the state of the cell is in edit mode. do you know how I can force the panel or what ever control on the column to always appear.. ?
thanks kindly for your help...
ASKER
moderator can i delete this question? i have found the solution..
Can you post your solution? I was trying to find one and I could not so it would be nice if you show it.
Also you should ask the moderators to delete the question in the support rubric, not here because moderators don't read all questions here...
Also you should ask the moderators to delete the question in the support rubric, not here because moderators don't read all questions here...
ASKER
Hi TheAvenger,
my solution is probably not such a good one, but it works.. Until i have time to create a totally new datagrid..
basically, what i did is inherit the datagrid class, and attach a container panel besides the last column on the datagrid. It just creates the illusion that the container panel and its sub-panels (containing whatever control is required) is part of the datagrid column.. but it is just an attachment.
my solution is probably not such a good one, but it works.. Until i have time to create a totally new datagrid..
basically, what i did is inherit the datagrid class, and attach a container panel besides the last column on the datagrid. It just creates the illusion that the container panel and its sub-panels (containing whatever control is required) is part of the datagrid column.. but it is just an attachment.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER