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

GridDateTimeColumn and width

6 Answers 168 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 12 Jul 2012, 02:34 PM
I'm trying to set the column width in the ItemCreated event:



If (e.Item is GridEditableItem && 
e.Item.IsInEditMode)<BR>{<BR>    GridEditableItem item = 
(GridEditableItem)e.Item;<BR>    RadDatePciker beginDate = 
(RadDatePicker)item["beginDate"].Controls[0];<BR>    beginDate.Width 
= Unit.Pixel(102);<BR>}<BR>

The first time I enter edit mode, the control briefly display the message 'the Calendar Popup.' and adjust the width of the editbox smaller to fit this message.  The message is ultimately replaced with the calendar icon, but the width of the edit box remains small until the next time a row is put in edit mode.

Can I change this message to a blank to force it to not resize the edit box ?

6 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 17 Jul 2012, 12:21 PM
Hello Ron,

I followed your scenario and prepared a sample runnable project and I was able to set width of GridDateTimeColumn width is working properly. I am attaching my test page for your reference. Give it a try and let me know if it works for you or you need additional assistance.

Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ron
Top achievements
Rank 1
answered on 18 Jul 2012, 06:46 PM
This works well until I add the RadGrid as a recipient in the AjaxManager.  For example, if I have a button that needs to load some different text into the grid and want to show a LoadingPanel. 
<telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
    <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="button">
        <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="panel2" LoadingPanelID="RadAjaxLoadingPanel1" />
        </UpdatedControls>
      </telerik:AjaxSetting>
    </AjaxSettings>
  </telerik:RadAjaxManager>
  <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="" Transparency="20"
    InitialDelayTime="200" Height="100px" Width="100px">
    <div class="loading">
      <table style="width: 100%; height: 100%">
        <tr>
          <td style="text-align: center">
            <asp:Image ID="Image1" runat="server" ImageUrl="../Images/loading3.gif" AlternateText="loading" />
          </td>
        </tr>
      </table>
    </div>
  </telerik:RadAjaxLoadingPanel>

Then I see the same calendar message the first time a grid is placed in edit mode.

 

 

 

0
Pavlina
Telerik team
answered on 19 Jul 2012, 08:57 AM
Hi Ron,

As you are using Ajax, you can try explicitly registering the calendar skin to make sure that the problem is not related to loading styles after AJAX. You can use the RadStyleSheetManager control for this purpose:
http://www.telerik.com/help/aspnet-ajax/stylesheetmanager.html

This should resolve the issue.

Kind regards,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ron
Top achievements
Rank 1
answered on 20 Jul 2012, 05:33 PM
This pages just shows how to register custom skins.
I'm using an embedded skin (Office2007).  Can you show me how to register the calendar component for this?

I added the following with no change in the results.
  <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">  
    <StyleSheets>  
        <telerik:StyleSheetReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Skins.Office2007.Calendar.Office2007.css" />  
        <telerik:StyleSheetReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Skins.Office2007.Input.Office2007.css" />  
    </StyleSheets>  
</telerik:RadStyleSheetManager>  


Thanks
0
Pavlina
Telerik team
answered on 23 Jul 2012, 04:37 PM
Hello,

Try the following code and let me know how it goes:
<telerik:StyleSheetReference Assembly="Telerik.Web.UI"  Name="Telerik.Web.UI.Skins.Calendar.css" />
   <telerik:StyleSheetReference Assembly="Telerik.Web.UI"  Name="Telerik.Web.UI.Skins.Office2007.Calendar.Office2007.css" />

All the best,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ron
Top achievements
Rank 1
answered on 23 Jul 2012, 05:26 PM
Thanks,
That appears to have done the trick!
Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Ron
Top achievements
Rank 1
Share this question
or