Skip to main content

Microsoft Silverlight

How to show a DataGrids's CellEditingTemplate when its height is bigger than the row ? (its clipping by default)RSS Feed

(0)

joer00
joer00

Member

Member

145 points

113 Posts

How to show a DataGrids's CellEditingTemplate when its height is bigger than the row ? (its clipping by default)

Hi,

I show data in a grid and need an complex editor to alter the data. When editing the cell the Editor is clipped to the row height. As of many posts here there is no rows collection so I cannot dynamically alter the height. Whats the solution to solve this ?

Preferable I want to use custom user controls as an edit template. One ugly workaround is to dynamically set the content of teh RowDeatils template and than alter the visibility status.

I hope there is a better solution ?

Joe Robe

swildermuth
swildermuth

Star

Star

8320 points

1,546 Posts

Re: How to show a DataGrids's CellEditingTemplate when its height is bigger than the row ? (its clipping by default)

The DataGrid is still pretty young code so I would guess it will get better, but for now you might wantt to consider having your user control Override Measure to ensure that the DataGrid knows how big it is.

(If this has answered your question, "Mark as Answer")

Shawn Wildermuth
C# MVP, MCSD, Speaker and Author

Silverlight 3 Workshop
Miami, FL: Oct 12-14th
Portlant, OR: Dec 2-4th
Atlanta, GA: Dec 7-9th
http://silverlight-tour.com

joer00
joer00

Member

Member

145 points

113 Posts

Re: How to show a DataGrids's CellEditingTemplate when its height is bigger than the row ? (its clipping by default)

thanks but doing

this.Measure(new Size(200, 200));

in my user control results in a CRASH (attempt to override protected memory).

Before I report this as a bug, did I do something wrong ?

Joe Robe

swildermuth
swildermuth

Star

Star

8320 points

1,546 Posts

Re: Re: How to show a DataGrids's CellEditingTemplate when its height is bigger than the row ? (its clipping by default)

Sorry, you should override the OnMeasure, not call Measure...so that the contain should call you when its ready to measure.

(If this has answered your question, "Mark as Answer")

Shawn Wildermuth
C# MVP, MCSD, Speaker and Author

Silverlight 3 Workshop
Miami, FL: Oct 12-14th
Portlant, OR: Dec 2-4th
Atlanta, GA: Dec 7-9th
http://silverlight-tour.com

joer00
joer00

Member

Member

145 points

113 Posts

Re: Re: How to show a DataGrids's CellEditingTemplate when its height is bigger than the row ? (its clipping by default)

unfortuantely that does not work either. No error this time but the cell just stays the same size.

 Did I still do something wrong or is it a bug in DataGrid ?

 protected override Size MeasureOverride(Size availableSize)
{
return new Size(100, 100);
}

Joe Robe

lawazia
lawazia

Member

Member

126 points

59 Posts

Re: Re: How to show a DataGrids's CellEditingTemplate when its height is bigger than the row ? (its clipping by default)

Is there any solution for this ? I am also facing the same problem.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities