Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
96 views
Hello,

I have a quick question. I would like to know if it is possible to implement Column Filtering for Hierarchy Data using the NeedDataSource event and the Self-Referencing  method for generating the Hierarchy.

In the NeedDataSource event handler I have only this :

RadGrid1.DataSource = ClassLibrary1.Service.Getdata().Where(x => x.Monthdate == DateTime.Parse("2010-12-01 00:00:00.000"));


This returns a subset of my data and the Grid is displayed fine, with working sorting and paging and hierarchy browsing.

The problem occurs on Filtering, where a AsyncPostbackError exception event  is raised  with this information for the inner exception property :

        Message    "Object reference not set to an instance of an object."
        Stack Trace :
              
at Telerik.Web.UI.GridColumn.set_CurrentFilterValue(String value)
at Telerik.Web.UI.GridColumn.set_CurrentFilterValue(String value)
at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfte

I read that Hierarchy Filtering is not possible with the basic data binding method calling DataBind(). I am not using that method, so If you could tell me if the approach used is a correct one or the errors I'm getting are triggered by some other problem?


Thanks in Advance.

Tsvetina
Telerik team
 answered on 28 Sep 2011
2 answers
112 views
Here is my problem:

I have RadWindow with NavigateUrl
function ShowDriverWindow(sender, eventArgs) {
              var hack = "499628";
               var url = "DriverInfo.aspx?hack=" + hack;
               var oWnd = radopen(url, "RadWindowDriverInfo");
               eventArgs.set_cancel(true);
           }

I pass the parameter "hack" to the navigate page.
On this page i have LINQ querry to get info about this driver in Page_Load().
var driverInfo = (from dr in db.T_DRIVERs
                                where dr.HACK_ID == int.Parse(hackId)
                                 select new {
                                 ...
                                 dr.MEDALLION_ID,
                                 ...
                           }).Single();

then I set the Selected Value in RadComboBox according to the LINQ querry
RadComboBoxSteadyMedl.SelectedValue =
                        driverInfo.MEDALLION_ID.ToString();

And now my problems start. I have "Save" button. When i change value in RadComboBox and click "Save" i still have predefined value. So
no changes are done.

If I Don't set the driver's medallion in Page_Load() everything works fine! after selecting new item in ComboBox I have new "selected value" in SaveButton_Click.

Any ideas??? 










Andrew
Top achievements
Rank 1
 answered on 28 Sep 2011
1 answer
89 views
Is int possible to connect Labels with pie piece with some line? If there is several smaller pieces it's hard to combine it in mind.
Evgenia
Telerik team
 answered on 28 Sep 2011
0 answers
135 views
I'm working on the RadGrid batch update like the one shown in one of the demos. I need to disable textbox in a template column of the RadGrid based on the condition.

If the column was a BoundColumn I would use the following code in the Grid's PreRender event. But how to handle this with the batch update Grid and a TemplateColumn.

Private Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender
     Dim status As String = Request.QueryString(0)
     If status = "Future" Then
         For Each column As GridColumn In RadGrid1.Columns
             If (column.UniqueName = "Start_Dt") Then
                 CType(column, GridBoundColumn).ReadOnly = False
                 CType(column, GridBoundColumn).DataFormatString = "{0:D}"
                 Exit For
             End If
         Next
     Else
         For Each column As GridColumn In RadGrid1.Columns
             If (column.UniqueName = "BoundDate") Then
                 CType(column, GridBoundColumn).ReadOnly = True
                 CType(column, GridBoundColumn).DataFormatString = "{0:D}"
                 Exit For
             End If
         Next
     End If
 End Sub

Thank you!!
Neelima
Top achievements
Rank 1
 asked on 28 Sep 2011
3 answers
190 views
I've got a RadScheduler with a height set by Javascript.  I'd like to run some additional Javascript function (to maintain the height) when a user clicks to toggle the view between Day / Week / Month / Timeline.  Is there some client event that fires when these buttons are clicked, or some other way to maintain a height parameter that has been set on the client side?
Plamen
Telerik team
 answered on 28 Sep 2011
5 answers
182 views
Hello,

I would like to create a Menu in which, for each item, i would display an image above the text. Normally, the image is display to the left of the text.
How can i do to obtain the result i need?

Thank You.
Dimitar Terziev
Telerik team
 answered on 28 Sep 2011
1 answer
132 views

It's ok after delete appointment.
But popup does not open after insert appointment. (doubleclick or edit of contextmenu)
I don't know why.
So help me, please.

  • aspx code
<telerik:RadScheduler ID="RadSchedulerTemplate" runat="server" EnableEmbeddedSkins="false"
EnableDescriptionField="true" Height="800"
SelectedView="DayView" DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End"
DataDescriptionField="Description" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID">
<AdvancedForm Modal="true" />
<AppointmentContextMenuSettings EnableDefault="true" />
<TimeSlotContextMenuSettings EnableDefault="true" />
</telerik:RadScheduler>

  • vb code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
GetSchedule()
End If
End Sub

Private Sub GetSchedule()
Dim dbConnection As SqlConnection = New SqlConnection
Dim dbCommand As SqlCommand = New SqlCommand
Dim dbReader As SqlDataReader = Nothing

dbConnection.ConnectionString = ConfigurationManager.ConnectionStrings("Test").ConnectionString
dbConnection.Open()
dbCommand = dbConnection.CreateCommand
dbCommand.CommandType = CommandType.StoredProcedure
dbCommand.CommandText = "S_GetSchedule"
dbReader = dbCommand.ExecuteReader


RadSchedulerTemplate.DataSource = dbReader
RadSchedulerTemplate.DataBind()

End Sub

... and insert, delete, update code.


And I have another question.
Why does not updated after update appointment?
When I delete or insert, Immediately, I can see rebind data.
But updating does not. Why?

So...I expect your answer. 
(Forgive my basic English skills)

Ivana
Telerik team
 answered on 28 Sep 2011
2 answers
109 views
Hello every one,

How to bind radtextbox in add mode in radgrid_itemcreated,
For Example, i have bind radcomobobox like that i want bind radtextbox, label ,
In bold are radtext i find like that all are come but not assign the values

.cs

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
           {
               if (e.Item.OwnerTableView.IsItemInserted)
               {
                   GridEditFormItem item = (GridEditFormItem)e.Item;
                   RadComboBox RadComboBox_Mainwork = (RadComboBox)item.FindControl("RadComboBox_Mainwork");
                   RadComboBox RadCombo_SubWork = (RadComboBox)item.FindControl("RadCombo_SubWork");
                   RadTextBox projectcode = (RadTextBox)item.FindControl("projectcode");
                   Label projectcode1 = (Label)item.FindControl("projectcode1");
                   RadComboBox RadComboBox1 = (RadComboBox)item.FindControl("RadComboBox1");
 
                   using (var db = new DoskContractServicesDataContext(Globals.strCon))
                   {
                       var orgreqfinal = (from a in db.dsmainworks
                                          select new { a.maincode, a.mainname }).ToList();
                       RadComboBox_Mainwork.DataSource = orgreqfinal;
                       RadComboBox_Mainwork.DataValueField = "maincode";
                       RadComboBox_Mainwork.DataTextField = "mainname";
                       RadComboBox_Mainwork.Items.Insert(0, new RadComboBoxItem("Select Main Work", "-1"));
}
}
}


.aspx
<telerik:RadComboBox ID="RadComboBox_Mainwork" runat="server" Width="85%" DataValueField="maincode"
                                                            DataTextField="mainname" MaxLength="6" AppendDataBoundItems="true"></telerik:RadComboBox>




Thanks,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 28 Sep 2011
1 answer
121 views

Hello,

We used the property RadTextBox control TextMode = "Multiline" within <ItemTemplate> </ telerik: RadPanelItem>, and there is a delay between when the user types and what is displayed in RadTextBox. Property without the property TextMode = "Multiline" is not delayed. You can use the following code:

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
            <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Width="567px" 
                Skin="Office2007">
                <Items>
                    <telerik:RadPanelItem Expanded="True" Text="Date generale" runat="server"> 
                        <Items>
                            <telerik:RadPanelItem Value="AccountInformation" runat="server" Expanded="true" >
                                <ItemTemplate>
                               <table  width="500px" border="0">
        <tr>
               <td valign="top" width="201">
                <asp:Label runat="server" ID="Label3"  Text="Domeniu" 
                   ></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadComboBox ID="cboTip" 
            runat="server" 
            Height="200px" 
            Width="220px" AutoPostBack="True" Skin="Office2007"
           >
        </telerik:RadComboBox>
            </td>
        </tr>
        <tr>
           <td valign="top" class="style6" >
                <asp:Label ID="Label2" runat="server" Text="Subdomeniu" 
                   ></asp:Label>
            </td>
            <td valign="top">
                  <telerik:RadComboBox ID="cboSub" runat="server" AutoPostBack="True" 
                      Height="200px" Skin="Office2007" Width="220px">
                  </telerik:RadComboBox>
            </td>
        </tr>
         <tr>
           <td valign="top" class="style6" >
                <asp:Label ID="Label4" runat="server"  Text="Nr. crt." ></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadNumericTextBox ID="txtNr" runat="server" Type="Number" 
                    NumberFormat-DecimalDigits="0" Skin="Office2007">
                        </telerik:RadNumericTextBox>
  
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Camp obligatoriu"
            ControlToValidate="txtNr" ForeColor="Red"></asp:RequiredFieldValidator>
  
            </td>
        </tr>
          <tr>
           <td valign="top" class="style6" >
                <asp:Label ID="Label5" runat="server" Text="Data" ></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadDatePicker ID="txtData" runat="server" Skin="Office2007">
                    <Calendar ID="Calendar1" runat="server" Skin="Office2007" UseColumnHeadersAsSelectors="False">
                    </Calendar>
                    <DateInput   DateFormat="dd.MM.yyyy" DisplayDateFormat="dd.MM.yyyy">
                    </DateInput>
                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                </telerik:RadDatePicker>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Camp obligatoriu"
            ControlToValidate="txtData" ForeColor="Red"></asp:RequiredFieldValidator>
  
            </td>
        </tr>
          <tr>
           <td valign="top" class="style6" >
                <asp:Label ID="Label6" runat="server"  Text="Segment" ></asp:Label>
            </td>
            <td valign="top">
               <telerik:RadTextBox runat="server" ID="txtSegment" Skin="Office2007" 
                    Width="300px"></telerik:RadTextBox>
  
                      
            </td>
        </tr>
    </table>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem Expanded="true"  Text="Valori indicator" runat="server">
                        <Items>
                            <telerik:RadPanelItem Expanded="true" Value="valori" runat="server">
                                    <ItemTemplate>
                                      <table  width="500px" border="0">
        <tr>
               <td valign="top" class="style7">
                <asp:Label ID="Label7" runat="server"  Text="Capitol standard / Cod defect" 
                   ></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadTextBox ID="txtCapitol" runat="server" Skin="Office2007" 
                    Width="300px">
                </telerik:RadTextBox>
            </td>
        </tr>
        <tr>
           <td valign="top" class="style7" >
                <asp:Label ID="Label8" runat="server"  Text="Proces" ></asp:Label>
            </td>
            <td valign="top">
                  <telerik:RadTextBox ID="txtProces" runat="server" Skin="Office2007" 
                      Width="300px">
                  </telerik:RadTextBox>
            </td>
        </tr>
         <tr>
           <td valign="top" class="style7" >
                <asp:Label ID="Label12" runat="server" 
                    Text="Neconformitatea / aspect reclamat" Width="172px"></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadTextBox ID="txtNeconf" runat="server" Height="60px" 
                    Skin="Office2007" TextMode="MultiLine" Width="300px">
                </telerik:RadTextBox>
  
            </td>
        </tr>
          <tr>
           <td valign="top" class="style7" >
                <asp:Label ID="Label10" runat="server" Text="Cauza" 
                   ></asp:Label>
            </td>
            <td valign="top">
                <asp:TextBox ID="txtCauza" runat="server" Width="300px"  Height="60px" TextMode="MultiLine"></asp:TextBox>
  
            </td>
        </tr>
          <tr>
           <td valign="top" class="style7" >
                <asp:Label ID="Label11" runat="server"  Text="Actiuni" ></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadTextBox ID="txtActiuni" runat="server" Height="60px" 
                    Skin="Office2007" TextMode="MultiLine" Width="300px">
                </telerik:RadTextBox>
  
                      
            </td>
        </tr>
           <tr>
               <td valign="top" width="201">
                <asp:Label runat="server" ID="Label3"  Text="Recourent" 
                   ></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadComboBox ID="cboRecurent" 
            runat="server" 
            Height="200px" 
            Width="220px" AutoPostBack="True" Skin="Office2007"
           >
        </telerik:RadComboBox>
            </td>
        </tr>
           <tr>
               <td valign="top" width="201">
                <asp:Label runat="server" ID="Label9"  Text="Tip recurenta / neconformitate" 
                   ></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadComboBox ID="cboTipRec" 
            runat="server" 
            Height="200px" 
            Width="220px" AutoPostBack="True" Skin="Office2007"
           >
        </telerik:RadComboBox>
            </td>
        </tr>
         <tr>
               <td valign="top" width="201">
                <asp:Label runat="server" ID="Label13"  Text="Punctaj" 
                   ></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadComboBox ID="cboPunctaj" 
            runat="server" 
            Height="200px" 
            Width="220px" AutoPostBack="True" Skin="Office2007"
           >
        </telerik:RadComboBox>
            </td>
        </tr>
           <tr>
               <td valign="top" width="201">
                <asp:Label runat="server" ID="Label14"  Text="Audit de referinta" 
                   ></asp:Label>
            </td>
            <td valign="top">
                <telerik:RadComboBox ID="cboAudit" 
            runat="server" 
            Height="200px" 
            Width="220px" AutoPostBack="True" Skin="Office2007"
           >
        </telerik:RadComboBox>
            </td>
        </tr>
    </table>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelItem>
                    
                </Items>
                <CollapseAnimation Duration="100" Type="None" />
                <ExpandAnimation Duration="100" Type="None" />
            </telerik:RadPanelBar>
  
             
              
              
        </telerik:RadAjaxPanel>

Thanks

 

Princy
Top achievements
Rank 2
 answered on 28 Sep 2011
2 answers
289 views
Hi,

I create (server-side) a context menu for a RadTree and set the menu item clicked event:
radTreeView.OnClientContextMenuItemClicked = "OnCatalogTreeItemClicked";

This is the menu item I add:
RadTreeViewContextMenu contextMenu = new RadTreeViewContextMenu();
contextMenu.ClickToOpen = true;
 
RadMenuItem item = new RadMenuItem("Delete this node");
item.Value = "delete";
contextMenu.Items.Add(item);
radTreeView.ContextMenus.Add(contextMenu);

How can I access the item's value (="delete") in the client-side javascript event?
It's quite easy to get the menu item from the event args and also the caption, but how do I get the value?
Or is the value only supposed for server-side usage and I have to add the value as an attribute to the menu item?

Thanks for your help!
JP
Top achievements
Rank 1
 answered on 28 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?