Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
130 views
hi Telerik
I want to show/hide one column in hirarchial grid with 2 nested detail tables on the click of a checkbox or a button. kindly help me on how to do this. I have tried the following by placing it at various places in rad grid pre render event or on click of button or on click of checkbox. but the problem is that it does show the column but without the column header. though column header text does exist in the aspx page.


foreach

(GridDataItem item in RadGrid1.Items)

{

if (item.OwnerTableView.Name != "Signpost")

{

GridBoundColumn detailColumn = (GridBoundColumn)item.OwnerTableView.GetColumn("overview");

detailColumn.Display =

true;

detailColumn.Visible =

true;

item[

"overview"].Visible = true;

 }

}

kindly help on how to get this working.i have seen all set of examples for this on the forum but couldnt get it done for myself.

ASP.Net version is 2.0 and Rad controls for asp.net ajax  2008 Q1

 many thanks and best regards
Ash

Ash
Top achievements
Rank 1
 answered on 28 Aug 2008
9 answers
2.1K+ views
Hello,

It seems that I got a trivial issue that is related to the wrap text property for a bound column. I.e. I set the columns width to 20px, and the text in the cell is like that "text sldjkask tesxt  adf sfg sdf dlkjwrwe sfglhwetr sdgfwer sdgsdfg wtr bdfs er y cv,d gieu werf.gm iergy i4 ".

My expectation is that in the cell this text will be in few lines - however, this is not so - and it is one line anyway.

Please advice what I'm doing wrong?

Many thanks,
Daniel
Telerik team
 answered on 28 Aug 2008
3 answers
128 views
I'd like to disable the Add New Command Button when the user clicks on the Edit icon for an existing record in the Grid.  Please also note that I am using RadAjaxLoadingPanel to update/insert/add records.

Please let me know if this is possible.
Shinu
Top achievements
Rank 2
 answered on 28 Aug 2008
3 answers
183 views
I dont know where to look here to fix. I am using RadAjax Manager v1.8.2.0. I have a simple asp checkbox defined in the manager to update a callbackPanel:
<rada:radajaxmanager id="RadAjaxManager1" runat="server" DESIGNTIMEDRAGDROP="278">  
                <AjaxSettings> 
                    <rada:AjaxSetting AjaxControlID="lbtRefresh">  
                        <UpdatedControls> 
                            <rada:AjaxUpdatedControl ControlID="CallbackPanel1"></rada:AjaxUpdatedControl> 
                        </UpdatedControls> 
                    </rada:AjaxSetting> 
                    <rada:AjaxSetting AjaxControlID="lbPullCredit">  
                        <UpdatedControls> 
                            <rada:AjaxUpdatedControl ControlID="CallbackPanel1"></rada:AjaxUpdatedControl> 
                        </UpdatedControls> 
                    </rada:AjaxSetting> 
                    <rada:AjaxSetting AjaxControlID="cxShowAllSubmissions">  
                        <UpdatedControls> 
                            <rada:AjaxUpdatedControl ControlID="CallbackPanel1"></rada:AjaxUpdatedControl> 
                        </UpdatedControls> 
                    </rada:AjaxSetting> 
                    <rada:AjaxSetting AjaxControlID="DataGrid1">  
                        <UpdatedControls> 
                            <rada:AjaxUpdatedControl ControlID="CallbackPanel1"></rada:AjaxUpdatedControl> 
                        </UpdatedControls> 
                    </rada:AjaxSetting> 
                    <rada:AjaxSetting AjaxControlID="btClose">  
                        <UpdatedControls> 
                            <rada:AjaxUpdatedControl ControlID="CallbackPanel1"></rada:AjaxUpdatedControl> 
                        </UpdatedControls> 
                    </rada:AjaxSetting> 
                </AjaxSettings> 
                <ClientEvents OnResponseEnd="OnResponseEnd" OnRequestStart="OnRequestStart"></ClientEvents> 
            </rada:radajaxmanager> 
the checkbox is set with autopostback true
<TR> 
                                    <TD style="HEIGHT: 20px" vAlign="top">  
                                        <asp:CheckBox id="cxShowAllSubmissions" runat="server" Text="Show All Submissions" AutoPostBack="True"></asp:CheckBox></TD>  
                                </TR> 

and it is attached to event

private

void cxShowAllSubmissions_CheckedChanged(object sender, System.EventArgs e)

{

BindSubmissions(

false);

}
 in code behind.

so the problem is that the event does not fire when Manager has code above, but if remove then it fires. The problem is that i need that control ajaxafied. I am new to Telerik and am sure im just misusing somehow.

Any Suggestions would be great.

BTW this is a .Net 1.1 app

Maria Ilieva
Telerik team
 answered on 28 Aug 2008
1 answer
87 views
Hi,
    Suppose i want to use same splitter in all of my pages and want the state of the splitter, pane and bar persist for current user session. i.e if user make some changes in the splitter of first page the same look persist for all other pages visited by the user afterwords. Please give me the solution.
Sophy
Telerik team
 answered on 28 Aug 2008
3 answers
129 views
i want to do some thing like window.open ()   function of javascript.
on the click of TreeView Leaf Node.

I tried  NavigateUrl Property of TreeViewNode  But It opens the new page in same window.

i m using LoadOn Demand functionality.

i  also tried to add attributes at run time.


Any Suggestions.


Thanks & Regards
Rishi Kasnia
(GrayCellTechnologiesExports)
Paul
Telerik team
 answered on 28 Aug 2008
2 answers
164 views
this is incredible, but
if i set AllowFilteringByColumn to false, the grid isn't formatting any more.

sample col that doesn't get formatted just by changing AllowFilteringByColumn to false...
is this a bug?

<telerik:GridBoundColumn DataField="Data1" HeaderText="Data 1"   
    UniqueName="Data1" 
    DataFormatString="{0:dd/MM/yyyy}" 
    DataType="System.DateTime" 
    ItemStyle-Width="140px" HeaderStyle-Width="140px">  
</telerik:GridBoundColumn> 
 




Luci
Top achievements
Rank 1
 answered on 28 Aug 2008
10 answers
270 views
I'm using the scheduler against a SharePoint List using an SPDataSource like this:

            <sharepoint:SPDataSource DataSourceMode="List" 
                Scope="Default" UseInternalName="true"   
                IncludeHidden="true"   
                ID="spdsCalendar" runat="server">  
                <SelectParameters> 
                    <asp:Parameter Name="ListName" DefaultValue="TravelCalendarList" /> 
                </SelectParameters> 
                <InsertParameters> 
                    <asp:Parameter Name="ListName" DefaultValue="TravelCalendarList" /> 
                </InsertParameters> 
                <UpdateParameters> 
                    <asp:Parameter Name="ListName" DefaultValue="TravelCalendarList" /> 
                </UpdateParameters> 
                <DeleteParameters> 
                    <asp:Parameter Name="ListName" DefaultValue="TravelCalendarList" /> 
                </DeleteParameters> 
            </sharepoint:SPDataSource> 

I have the Update wired up correctly:

        protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)  
        {  
            try 
            {  
                if ((e.ModifiedAppointment.Subject == String.Empty) | (e.ModifiedAppointment.Start > e.ModifiedAppointment.End))  
                {  
                    e.Cancel = true;  
                }  
                else 
                {  
                    e.Appointment.Subject = e.ModifiedAppointment.Subject;  
                    e.Appointment.Start = e.ModifiedAppointment.Start;  
                    e.Appointment.End = e.ModifiedAppointment.End;  
                }  
            }  
            catch (Exception ex)  
            {  
                lblError.Text = ex.Message.ToString();  
            }  
        }  
 

When I click Update I get the follow error:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

System.NullReferenceException: Object reference not set to an instance of an object.

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.OnDataSourceOperationComplete(Int32 count, Exception e) +16
   System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +69
   Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.Update(RadScheduler owner, Appointment appointmentToUpdate) +192
   Telerik.Web.UI.Scheduling.AppointmentController.UpdateAppointment(Appointment originalAppointment, Appointment modifiedAppointment) +363
   Telerik.Web.UI.RadScheduler.UpdateAppointmentInline(Boolean removeExceptions) +195
   Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args) +235
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +132
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

I have written out the values from ModifiedAppointment to a label and it all looks correct. Both Insert and Delete work fine.

Anyone have an ideas as to what's going wrong with the Update?

cheers,

Steve
Paul
Telerik team
 answered on 28 Aug 2008
1 answer
355 views
I have a FormTemplate which I use for both edit and insert actions in my radGrid. I use a RadNumericTextBox within the template, and declare it as follows:

<

telerik:RadNumericTextBox ID="txtThreshold" runat="server" Width="104px" Value='<%# DataBinder.Eval(Container,"DataItem.threshold") %>'></telerik:RadNumericTextBox>

This works fine for editing, but when I try to use it for inserting I always get an InvalidCastException: "The specified cast is invalid" with the folowing stack trace:

   at ASP.configuration_alerts_aspx.__DataBinding__control24(Object sender, EventArgs e) in d:\Projects\WebMonitor\Web\Configuration\Alerts.aspx:line 77
   at System.Web.UI.Control.OnDataBinding(EventArgs e)
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()

Replacing the NumericTextBox with a standard TextBox works fine. I have also tried setting a custom value in the ItemCommand event, to really make sure there is a value being passed to the control:

protected

void gridAlertTypes_ItemCommand(object source, GridCommandEventArgs e)
{
if  (e.CommandName == RadGrid.InitInsertCommandName)
{
 
e.Canceled = true;
 System.Collections.Specialized.ListDictionary newValues = new  System.Collections.Specialized.ListDictionary();newValues["description"] = "New description";
 newValues["threshold"] = 55;
 e.Item.OwnerTableView.InsertItem(newValues);
}
}

But I still get the same error. I have also tried to declare the control so that the DataBinding only happens when in edit mode, and for insert I declare a hard-coded value of 0:

<telerik:RadNumericTextBox ID="txtThreshold" runat="server" Width="104px" Value='<%# (Container is GridEditFormInsertItem) ? 0 : DataBinder.Eval(Container,"DataItem.threshold") %>'></telerik:RadNumericTextBox>

But still no luck! I tried putting double quotes around the 0 as well. Which is strange, because if I use Value='0' that works fine, effectivly thats what the above statement should do when in insert mode. Any help would be appreciated!

Thanks
Michael

 

Missing User
 answered on 28 Aug 2008
1 answer
315 views
First of Is it possible to enable and disable this controls with javascript if so, Here is what I tried so far...

I found that your client objects have the folowwing two methods
enable no param no param Enables the date input control.
disable no param no param Disables the date input control.

Also I read that the javascript disable property won't work with <input type="hiden"/> which is what the controls are. So I think that is why you provided the two methods above.

**********************************************************
 I tried.....

<

script type="text/javascript" language=javascript>
function toggle_RadNumericTextBox(obj) {

if (obj.checked) {

//document.getElementById('<%=RadNumericTextBox1.ClientID%>').enable();//document.getElementById('<%=TextBox1.ClientID%>').disabled = true; this won't work becaust the input is hidden
$find("<%= RadNumericTextBox1.ClientID %>").enable();

}

else

$find(

"<%= RadNumericTextBox1.ClientID %>").disabled();

//document.getElementById('<%=RadNumericTextBox1.ClientID%>').disabled = true;

//document.getElementById('<%=TextBox1.ClientID%>').disabled = false;

}

function toggle_RadDateTimePicker(obj) {
if (obj.checked) {

document.getElementById(

'<%=RadDateTimePicker1.ClientID%>').disabled = false;

}

else

document.getElementById(

'<%=RadDateTimePicker1.ClientID%>').disabled = true;

}

function toggle_TextBox(obj) {

if (obj.checked) {

document.getElementById(

'<%=TextBox1.ClientID%>').disabled = false;

}

else

document.getElementById(

'<%=TextBox1.ClientID%>').disabled = true;

}

</

script>

<telerik:RadScriptManager ID="RadScriptManager1" runat="server"

OutputCompression="AutoDetect">

</telerik:RadScriptManager>

<div>

<asp:CheckBox ID="CheckBox1" runat="server" onclick="toggle_RadNumericTextBox(this);" />

<br />

<telerik:RadNumericTextBox ID="RadNumericTextBox1" Runat="server" >

</telerik:RadNumericTextBox>

<br />

<asp:CheckBox ID="CheckBox2" runat="server" onclick="toggle_RadDateTimePicker(this);"/>

<br />

<telerik:RadDateTimePicker ID="RadDateTimePicker1" Runat="server"

Culture="English (United States)">

</telerik:RadDateTimePicker>

<br />

<asp:CheckBox ID="CheckBox3" runat="server" onclick="toggle_TextBox(this);" />

<br />

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<br />

</div>

Your help is appreciated.

Missing User
 answered on 28 Aug 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?