This is a migrated thread and some comments may be shown as answers.

Overflowing one grid column

3 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexandru
Top achievements
Rank 1
Alexandru asked on 29 Jun 2015, 05:32 PM
I have a RadGrid in my .aspx file. The second to last column is GridDateTimeColumn:<telerik:GridDateTimeColumn DataField="IssueDate" HeaderText="ValidFrom"
HeaderStyle-Wrap="true" DataFormatString="{0:dd.MM.yyyy}"
meta:resourcekey="ValidFromResource" PickerType="DatePicker" Resizable="true">
<HeaderStyle Width="80px" />
</telerik:GridDateTimeColumn>
and the last column is a GridButtonColumn. In Edit mode (InPlace), the GridDateTimeColumn becomes a RadDatePicker. However, it can't fit in the 80px of the column (only a part of the textbox is visible, and the calendar not at all). I want the RadTimePicker to overflow over the GridButtonColumn Column (which doesn't appear in edit mode). I want to do that either in the .aspx file (if possible) or in the radGrid_ItemDataBound event.Any idea is appreciated. Thank you :)

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 02 Jul 2015, 04:05 PM
Hello,

Could you elaborate what exactly you mean by - I want the RadTimePicker to overflow over the GridButtonColumn Column (which doesn't appear in edit mode). If you  send us screenshot of the desired result we will be able to suggest a solution. Regarding the fact that GridDateTimeColumn cannot fit in the available space in edit mode you can find the datepicker control on ItemDataBound server side event of the grid and change its width to the desired value. More information for accessing controls is available here:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Alexandru
Top achievements
Rank 1
answered on 02 Jul 2015, 04:17 PM
I attached a picture. You can see that the RadDatePicker control is not visible entirely (the Calendar can not be seen). I could set a greater width for the GridDateColumn to fit the DateInput and the Calendar, but I want the Calendar to be exactly above the Delete Button.
0
Pavlina
Telerik team
answered on 03 Jul 2015, 08:18 AM
Hi,

Did you try setting smaller width to the picker control similar to the way shown below and let me know if this helps?

Protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)   
    {  
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)   
        {   
            GridEditableItem edititem = (GridEditableItem)e.Item;             
            RadDatePicker datePicker = (RadDatePicker)edititem["IssueDate"].Controls[0];   
            datePicker.Width = Unit.Pixel(50);   
        }   
    }

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Alexandru
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Alexandru
Top achievements
Rank 1
Share this question
or