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---^ |
<head runat="server"> <title></title> <script type="text/javascript"> <!-- function addItem() { var textBoxData = document.getElementById("txtData"); if (textBoxData.value.length > 0) { var listBoxData= document.getElementById("lsbSelectedData"); var newLength = listBoxData.length; listBoxData[newLength] = document.createElement("option"); listBoxData[newLength].text = textBoxData.value; } else { alert("Enter data"); } textBoxData.value = ""; textBoxData.focus(); return false; } function submitData() { var listBoxData = document.getElementById("lsbSelectedData"); // Ensure that barcodes have been entered if (listBoxData.options.length > 0) { // Store data in a hidden field as the contexts of a listbox // do not get posted back to the server var hiddenData = document.getElementById("hdnSelectedData"); var pipedData = ""; var index; for (var index = 0; index < listBoxData.options.length; index++) { pipedData += listBoxData.options[index].text + "|"; } hiddenData.value = pipedData; return true; } else { alert("Enter data"); var textBoxData = document.getElementById("txtData"); textBoxData.focus(); return false; } } // --> </script> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="ScriptManager1" runat="server" /> <telerik:RadAjaxManager ID="AjaxManager" runat="server" DefaultLoadingPanelID="AjaxLoadingPanel"> <AjaxSettings> <%--<telerik:AjaxSetting AjaxControlID="btnOK" > <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlDataEntry" LoadingPanelID="AjaxLoadingPanel" /> <telerik:AjaxUpdatedControl ControlID="lblResults" /> </UpdatedControls> </telerik:AjaxSetting>--%> </AjaxSettings> </telerik:RadAjaxManager> <asp:Panel ID="pnlDataEntry" runat="server"> <asp:TextBox ID="txtData" runat="server"></asp:TextBox> <asp:Button ID="btnAdd" runat="server" Text="Add" OnClientClick=" return addItem()" /> </asp:Panel> <asp:ListBox ID="lsbSelectedData" runat="server" Width="300" Height="200"></asp:ListBox> <asp:HiddenField ID="hdnSelectedData" runat="server" /> <br /> <asp:Button ID="btnOK" runat="server" Text="OK" onclick="btnOK_Click" OnClientClick="return submitData()"/> <%--<asp:Button ID="btnOK" runat="server" Text="OK" onclick="btnOK_Click"/>--%> <br /> <asp:Label ID="lblResults" runat="server"></asp:Label> <telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel" runat="server" Height="75px" Width="75px" BackColor="WhiteSmoke" CssClass="loadingImage" HorizontalAlign="Center"> <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="loading5.gif" /> </telerik:RadAjaxLoadingPanel> </form> </body>C# code:
public partial class TestPage: System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnOK_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); StringBuilder results = new StringBuilder(); // Get the formatted data from the hidden field string pipedData = hdnSelectedData.Value; if (!string.IsNullOrEmpty(pipedData)) { results.Append("Results:<BR />"); string[] enteredData = pipedData.Remove(pipedData.Length - 1).Split('|'); foreach (string data in enteredData) { results.AppendFormat("{0}<BR />", data); } } else { results.Append("Results: Nothing entered!"); } lblResults.Text = results.ToString(); } }function ShowDialogTest() {
var wnd = window.radopen("TestUpLoad.aspx", "Test");
wnd.setSize(700, 265);
wnd.set_modal(true);
wnd.center();
wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Resize);
wnd.show();
}
protected void cmbTest_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
if (e.Text.ToUpper() == "YES" || e.Text.ToUpper() == "NO")
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "Test", "ShowDialogTest();", true);
//Rest Of the Code
//Block 1
//Block2
}
}
but , i have been facing the following issues
1)i am unable to know how to pass a value from radwindow to the base page(from where it is called).
2)when i execute "ScriptManager.RegisterStartupScript" line to load popup, i would like to hold that line without executing till the value returns from the radwindow, based of the return value from the popup then i would like to execute either "Block1" or "Block2".
Please let me know the better solution for this.
Thanks in advance.