html
-------
<td class="td_AEV">
<asp:CheckBox ID="isAdmitted" runat="server" Text="Patient Admitted" Font-Size="8pt"
onclick="EnableAdmitDate();" />
</td>
<td class="td_AEV">
Admit Date:<telerik:RadDatePicker ID="radAdmitDate" runat="server" Font-Size="8pt"
Enabled="false" onblur="CheckForCompletedReqFlds('Chart');">
<Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"
runat="server">
</Calendar>
<DatePopupButton HoverImageUrl="" ImageUrl="" />
<DateInput ID="DateInput2" DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy" runat="server">
</DateInput>
</telerik:RadDatePicker>
</td>
js
----------
function EnableAdmitDate() {
if (document.getElementById("isAdmitted").checked == "1") {
var datepicker = <%= radAdmitDate.ClientID %>;
datepicker.DateInput.Enable();
datepicker.PopupButton.onclick = function()
{
datepicker.TogglePopup();
return false;
};
}
else {
var datepicker = <%= radAdmitDate.ClientID %>;
datepicker.DateInput.Disable();
datepicker.PopupButton.onclick = null;
}
}
js runtime
---------------
function EnableAdmitDate() {
if (document.getElementById("isAdmitted").checked == "1") {
var datepicker = radAdmitDate;
datepicker.DateInput.Enable();
datepicker.PopupButton.onclick = function()
{
datepicker.TogglePopup();
return false;
};
}
else {
var datepicker = radAdmitDate;
datepicker.DateInput.Disable();
datepicker.PopupButton.onclick = null;
}
}
We use RadComboBox inside RadWindow as the following:
<telerik:RadWindow ID="WinFirms" runat="server" Title="Select Firm" Width="500" Height="200" Behaviors="Move" VisibleStatusbar="false" VisibleOnPageLoad="false" Modal="true" EnableShadow="true" DestroyOnClose="false" Skin="Sunset"> <ContentTemplate> <div style="padding:10px;"> <div style="float:left; width:10px;"> Firm: </div> <div> <telerik:RadComboBox runat="server" ID="ddlFirm" Width="100%" MarkFirstMatch="True" CausesValidation="false" HighlightTemplatedItems="true"> <HeaderTemplate> <table style="width:95%" cellspacing="0" cellpadding="0" class="MultiColumnComboBox"> <tr> <td style="width: 50px">DFSA No</td> <td style="width: 100px">Firm Name</td> <td style="width: 50px">Capacity</td> </tr> </table> </HeaderTemplate> <ItemTemplate> <table style="width:100%" cellspacing="0" cellpadding="0" class="MultiColumnComboBox"> <tr> <td style="width: 20%; color:Gray;"><%#DataBinder.Eval(Container.DataItem, "DfsaNo")%> </td> <td style="width: 70%"><%#DataBinder.Eval(Container.DataItem, "DName")%></td> <td style="width: 10%; color:Gray;"><%#DataBinder.Eval(Container.DataItem, "Capacity")%></td> </tr> </table> </ItemTemplate> </telerik:RadComboBox> </div> </div> <div style="text-align:center;"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Firm is required" Display="Dynamic" ControlToValidate="ddlFirm"></asp:RequiredFieldValidator> <asp:Button runat="server" id="WinOK" OnClientClick="SubmitFirmDialog();return false;" Text="OK" UseSubmitBehavior="False" ValidationGroup="SubmitWindow" CausesValidation="true"/> <asp:Button runat="server" id="WinCancel" OnClientClick="Hide();return false;" Text="Cancel" UseSubmitBehavior="False" /> </div> </ContentTemplate></telerik:RadWindow>We Fill DDL as following
Sub LoadFirmData() ddlFirm.DataSource = FirmDetails.GetAfAspRaFirmByVal() ddlFirm.DataBind()End SubProtected Sub ddlFirm_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles ddlFirm.ItemDataBound e.Item.Text = e.Item.DataItem.DName e.Item.Value = e.Item.DataItem.PersonID & "%" & e.Item.DataItem.Capacity e.Item.Attributes.Add("FirmID", e.Item.DataItem.PersonID) e.Item.Attributes.Add("Capacity", e.Item.DataItem.Capacity) e.Item.Attributes.Add("DfsaNo", e.Item.DataItem.DfsaNo) End SubFirst page Load the data loads successfully and displayed inside the ComboBox.
When a callback happens the ComboBox loads all data as empty as the following HTML:
<li class="rcbItem rcbTemplate">
<table cellspacing="0" cellpadding="0" class="MultiColumnComboBox" style="width: 100%;">
<tbody><tr>
<td style="width: 20%; color: Gray;"> </td>
<td style="width: 70%;"></td>
<td style="width: 10%; color: Gray;"></td>
</tr>
</tbody></table>
</li>
At the same time when we assess the list items on client side we get the results of (value + attributes) correctly. But its not displayed in the dropdown.
I tried the solution suggested and didn't work.
I think my problem is related to Framework 4.0,
Web.config content
--------------------------
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="Telerik.Web.UI, Version=2008.3.1314.35, Culture=neutral, PublicKeyToken=121FAE78165BA3D4" />
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
</assemblies>
</compilation>
<httpHandlers>
<add path="Telerik.Web.UI.DialogHandler.aspx" verb="*" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
<add path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Version=2008.3.1314.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
<add path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI" />
</httpHandlers>
Bold line is highlighted in red when error occurs, I had copied file Telerik.Web.UI.dll to bin.
Thanks in advance.
Steve
Problem 1:
I have found a link on how to adjust the width of declaritive columns through code behind:
http://www.telerik.com/help/aspnet-ajax/grdusingcolumns.html
protected void RadGrid1_PreRender(object sender, System.EventArgs e) { foreach(GridColumn column in RadGrid1.Columns) { if (column.UniqueName == "BirthDate") { (column as GridBoundColumn).ReadOnly = true; (column as GridBoundColumn).DataFormatString = "{0:D}"; break; } } RadGrid1.Rebind(); } Although, when I use rebind() as in the example, the detailtable expand button stops working in my grid. When it is clicked the grid rebinds again and the rows never expand.
How do I get the Expand to work after implementing the above code?
Problem 2: How do I set the width of the columns in the code behind for the Detailtable? Can you please provide a simple example. Is it done in the PreRender event? Will I need to rebind the Detailtable as well?
Thanks so much for your time,
Kellie
| Dim requestParams() As String = e.Argument.Split(Microsoft.VisualBasic.ChrW(32)) | |
| Dim target As String = requestParams(0) | |
| Dim command As String = requestParams(1) | |
| If (target = "TimeSlot") Then | |
| If (command = "Insert") Then | |
| Dim index As String = requestParams(2) | |
| Dim timeSlot As ISchedulerTimeSlot = rsEvent.GetTimeSlotFromIndex(index) | |
| ^---Exception when in Day view---^ |