Click here to Skip to main content
16,003,474 members
Home / Discussions / C#
   

C#

 
AnswerRe: c# - protected and protected internal Pin
Expert Coming3-Jun-07 6:02
Expert Coming3-Jun-07 6:02 
GeneralRe: c# - protected and protected internal Pin
originSH3-Jun-07 21:59
originSH3-Jun-07 21:59 
QuestionLoading a bitmap into an ImageList Pin
Mark F.3-Jun-07 3:35
Mark F.3-Jun-07 3:35 
AnswerRe: Loading a bitmap into an ImageList Pin
Luc Pattyn3-Jun-07 3:46
sitebuilderLuc Pattyn3-Jun-07 3:46 
GeneralRe: Loading a bitmap into an ImageList Pin
Mark F.3-Jun-07 4:45
Mark F.3-Jun-07 4:45 
GeneralRe: Loading a bitmap into an ImageList Pin
Luc Pattyn3-Jun-07 5:10
sitebuilderLuc Pattyn3-Jun-07 5:10 
AnswerRe: Loading a bitmap into an ImageList Pin
Thomas Stockwell3-Jun-07 8:04
professionalThomas Stockwell3-Jun-07 8:04 
Questionuser control with a datagridview Pin
zwan133-Jun-07 3:27
zwan133-Jun-07 3:27 
I'm developing a user control which is build with a datagridview, and others controls.

When I use this control in my application at desing time, I'd like to access de properties of the datagridview embebed in my control to add columns. I've created a public property to expose de grid, something like this:

<br />
private System.Windows.Forms.DataGridView _grid;<br />
<br />
[Description("Description"), Category("mycategory"), EditorBrowsable]<br />
public System.Windows.Forms.DataGridView Grid<br />
{<br />
   get { return _grid; }<br />
   set { _grid = value; }<br />
}<br />

My problem is that I can't access the Columns property at desing time (In the property editor. I get this error:
Object reference not set to an instance of an object.

Then I decide to expose a property for the datagrid columns:
<br />
[Description("My Description"), Category("MyCategory"), EditorBrowsable]<br />
public DataGridViewColumnCollection MyColumns<br />
{<br />
  get { return this.grid1.Columns; }<br />
}<br />
Now I've binded the grid to a TableDataAdapter returned by a Web Sevice. My problen now is when I add a new column, the column is not show at execution time. (At desing time I can see the column added). I think that in execution time the grid executes the databinding and rewrites my added column. The same happens if I want to hide one of the columns returned by my Web Service, in execution time the column is visible.

Perhaps doing it programatically I could add and hide columns , but I want to do it the easiest possible for de developers who are going to use this control.


Thanks.
AnswerRe: user control with a datagridview Pin
xibeifeijian3-Jun-07 4:05
xibeifeijian3-Jun-07 4:05 
GeneralRe: user control with a datagridview [modified] Pin
zwan133-Jun-07 4:35
zwan133-Jun-07 4:35 
QuestionService that continously reads keyboard and make a log file? Pin
Gul_#3-Jun-07 2:51
Gul_#3-Jun-07 2:51 
AnswerRe: Service that continously reads keyboard and make a log file? Pin
WillemM3-Jun-07 4:30
WillemM3-Jun-07 4:30 
AnswerRe: Service that continously reads keyboard and make a log file? Pin
Dave Kreskowiak3-Jun-07 5:08
mveDave Kreskowiak3-Jun-07 5:08 
GeneralRe: Service that continously reads keyboard and make a log file? Pin
Paul Conrad3-Jun-07 5:16
professionalPaul Conrad3-Jun-07 5:16 
GeneralRe: Service that continously reads keyboard and make a log file? Pin
Dave Kreskowiak3-Jun-07 7:13
mveDave Kreskowiak3-Jun-07 7:13 
GeneralRe: Service that continously reads keyboard and make a log file? Pin
Paul Conrad3-Jun-07 15:05
professionalPaul Conrad3-Jun-07 15:05 
GeneralRe: Service that continously reads keyboard and make a log file? Pin
Dave Kreskowiak3-Jun-07 17:04
mveDave Kreskowiak3-Jun-07 17:04 
QuestionHow to record a phone call?? Pin
r_jaz3-Jun-07 2:39
r_jaz3-Jun-07 2:39 
AnswerRe: How to record a phone call?? Pin
crash8933-Jun-07 15:02
crash8933-Jun-07 15:02 
GeneralRe: How to record a phone call?? Pin
r_jaz3-Jun-07 19:44
r_jaz3-Jun-07 19:44 
QuestionInterface Pin
Rahul832-Jun-07 23:53
Rahul832-Jun-07 23:53 
AnswerRe: Interface Pin
Arun.Immanuel3-Jun-07 0:16
Arun.Immanuel3-Jun-07 0:16 
AnswerRe: Interface Pin
Hesham Yassin6-Jun-07 8:29
Hesham Yassin6-Jun-07 8:29 
QuestionSearching for an easy way to write fuctions name... Pin
Arish rivlin2-Jun-07 22:15
Arish rivlin2-Jun-07 22:15 
AnswerRe: Searching for an easy way to write fuctions name... Pin
DavidNohejl3-Jun-07 2:26
DavidNohejl3-Jun-07 2:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.