Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
122 views
Hi,

i am working on telrik tree view.

 <telerik:RadTreeView runat="server" ID="RadTreeView1" OnContextMenuItemClick="RadTreeView2_ContextMenuItemClick"  OnClientContextMenuItemClicked="onContextMenuItemClicked"
                             OnClientNodeClicked="nodeClicked">

i want to call two functions on contextmenuitemclick i.e clientside and server side. in my case only clientside function is calling. plz guide me how to call the both functions. one more thing that this treeview is inside update Panel.

Regards,

Faisal
Shinu
Top achievements
Rank 2
 answered on 06 Jun 2011
4 answers
181 views
I could do with some more help.

In my RadGrid I have created a custom edit form using the template mode and I have captured the update command event  to intercept the update as i want to write the information entered by the user manually to my database.

In the update command event I have converted e.item to a GridEditFormItem and now I want to get access to the controls that i have added into my template. There seems to be lots of controls embedded in this item so is there an easier to access the data entered by the user. I have a RadTextBox and RadDateTimePicker.

Thankyou.
Tsvetina
Telerik team
 answered on 06 Jun 2011
1 answer
80 views
Hi, I have scheduler databound to a sql datasource successfully. In the NavigationCommand I am getting the type of navigation and then changing the Scheduler's selected date like this


  RadScheduler1.SelectedDate = CurrentDate.AddDays(1)


   But this does not affect the selected date. I am in DayView so I just want the calendar to advance 1 day but this does not work. I have tried issuing the rebind command but that does not work either. I think I am not understanding how the scheduler binds to its data in this situation. I see appointments, I just cannot navigate using the upper left corner navigation controls. Any clarification on this would be most welcome.
Plamen
Telerik team
 answered on 06 Jun 2011
2 answers
160 views
My scheduler works fine.But my requirement is,

if I create a time slot from 9.00 am to 10.00 am ,I need  to display it for users as smaller slots of 10 minutes and each slot is considered as seperate item .

What i mean is

9.00 t0 9.10
9.10 t0 9.20
9.20 t0 9.30  etc up to 10.00 and users can select each slot
is it possible or not ?
Rakesh
Top achievements
Rank 1
 answered on 06 Jun 2011
2 answers
195 views
Hi,

I am trying to get the RadSpell control to work in a custom pagelayout in SharePoint 2010.

I have added the control but I continually get the web.config registration entries missing error, regardless of what entries I add to the web.config file.

I have followed the directions supplied by this KB article. Including renaming the aspx to axd as suggested for running this in MOSS, but to no avail.

Please, note that the solutions above will not work for MOSS 2007 and MVC applications. To fix the problem:

  1. open the web.config file and replace Telerik.Web.UI.DialogHandler.aspx with Telerik.Web.UI.DialogHandler.axd
  2. set the RadEditor's DialogHandlerUrl property to "~/Telerik.Web.UI.DialogHandler.axd"
If I follow the instructions above I get the following stack trace

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadSpell.ResetDialogDefinition() +1388
   ASP._controltemplates_clsg_reportsclass_ascx.__BuildControlradSpellCheck() +135
   ASP._controltemplates_clsg_reportsclass_ascx.__BuildControlTree(_controltemplates_clsg_reportsclass_ascx __ctrl) +186
   System.Web.UI.ControlBuilder.BuildChildren(Object parentObj) +424
   System.Web.UI.TemplateBuilder.InstantiateIn(Control container) +437
   System.Web.UI.WebControls.ContentBuilderInternal.InstantiateIn(Control container) +34
   ASP.PORTAL_MASTER_1110935397.__BuildControlPlaceHolderMain() +176
   ASP.PORTAL_MASTER_1110935397.__BuildControlMSO_ContentDiv() +1205
   ASP.PORTAL_MASTER_1110935397.__BuildControlForm1() +589
   ASP.PORTAL_MASTER_1110935397.__BuildControlHtml1() +300
   ASP.PORTAL_MASTER_1110935397.__BuildControlTree(PORTAL_MASTER_1110935397 __ctrl) +88
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +1304
   System.Web.UI.Page.get_Master() +68
   System.Web.UI.Page.ApplyMasterPage() +17
   System.Web.UI.Page.PerformPreInit() +57
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1255

What am I doing wrong?

Any help would be much appreciated.

Thanks in advance
Peter
Stephen
Top achievements
Rank 1
 answered on 06 Jun 2011
1 answer
291 views
I am trying use the sorting properties in the radgrid, and I am wondering if there is a way to sort the data bound to the grid without hitting the database again.  My problem is when I do not hit the database and attempt to sort, my data in the grid disappears.

My radgrid is set up to look like this:
<radG:RadGrid ID="CustomerGrid" runat="server" AutoGenerateColumns="false" Width="100%" EnableAJAX="True" OnPageIndexChanged="SearchResults_PageIndexChanged" 
    Skin="Office2007" AllowFilteringByColumn="False" AllowPaging="True" PageSize="35" ShowStatusBar="True" ShowFooter="False" 
    ShowGroupPanel="False" GridLines="None" CellPadding="1" AllowSorting="True" OnSortCommand="RadGrid1_SortCommand">
    <PagerStyle Mode="NextPrevAndNumeric" />
    <MasterTableView EditMode="InPlace" ShowFooter="True" Width="99%" TableLayout="Auto" AllowMultiColumnSorting="true" AllowNaturalSort="true">
        <Columns>
            <radG:GridBoundColumn DataField="CustomerID" HeaderText="Customer Number" SortExpression="CustomerID" UniqueName="CustomerID">
            </radG:GridBoundColumn>
            <radG:GridBoundColumn DataField="CustomerName" HeaderText="Customer Name" SortExpression="CustomerName" UniqueName="CustomerName">
            </radG:GridBoundColumn>
            <radG:GridTemplateColumn HeaderText="Status" HeaderStyle-Width="160px" ItemStyle-Width="160px">
                <ItemTemplate>
                    <%# GetStatus(Eval("CustomerID")) %>
                </ItemTemplate>
            </radG:GridTemplateColumn>
            <radG:GridBoundColumn DataField="Effective" HeaderText="Effective">
            </radG:GridBoundColumn>
        </Columns>
        <ExpandCollapseColumn Visible="False">
            <HeaderStyle Width="19px" />
        </ExpandCollapseColumn>
        <RowIndicatorColumn Visible="False">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
    </MasterTableView>
    <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
        <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
    </ClientSettings>
</radG:RadGrid>

My code behind methods for sorting and loading the radgrid are shown below:
protected void SearchResults_PageIndexChanged(object source, Telerik.WebControls.GridPageChangedEventArgs e)
{
    LoadData();
}
  
protected void RadGrid1_SortCommand(object source, Telerik.WebControls.GridSortCommandEventArgs e)
{
    if (!e.Item.OwnerTableView.SortExpressions.ContainsExpression(e.SortExpression))
    {
        GridSortExpression sortExpr = new GridSortExpression();
        sortExpr.FieldName = e.SortExpression;
        sortExpr.SortOrder = GridSortOrder.Ascending;
  
        e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
    }
  
}

The LoadData method is used to get the results from the database and returns a data set which I bind to the radgrid.

The Sort method I tried using from the demo, I found here:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/sorting/defaultcs.aspx


From this I would like to be able to sort all of my columns, except for the effective column, in ascending or descending order depending on what the user selects.  I was also curious if you could offer up any assitance as to how to go about sorting my Item Template column, if that is possible.  Since, my CustomerID is bound to the column and I just use code to display the customer's status, I was not sure if this was possible to sort by the actual status name.

Any assistance would be appreciated. Thanks.

Joe
Iana Tsolova
Telerik team
 answered on 06 Jun 2011
2 answers
84 views
Hello, I have a radgrid that is being populated with a mysql odbc datasource. I am trying to get the update command to update information from my edited item to the database. as of right now, if you click edit, the item goes into edit mode. if you add text then click update, it postsback, but no data is loaded to the database. I need this to work as an itemCommand "Update" in a select case as I need to dynamically populate data to be added through another function. I have tried using just a standard "OnUpdate" but that also is not working. here is the offending code, HELP PLEASE 




*****Previous Code*****

  Protected Sub gridfflistings_UpdateCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        Dim rowid As String = gridfflistings.MasterTableView.DataKeyValues(e.Item.ItemIndex)("propertyid")
        Dim Dlink As String = editedItem("txtlink").Text
        Dim add1 As String = editedItem("address").Text
        Dim propid As String = rowid.ToString
        Dim upstr As String = "update fflistings set mlsnumber=?, directlink=? where propertyid=?;"
        Dim upcon As New OdbcConnection(sConnectionString)
        upcon.Open()
        Using upcom As New OdbcCommand(upstr, upcon)
            upcom.Parameters.AddWithValue("mlsnumber", "11111")
            upcom.Parameters.AddWithValue("directlink", Dlink.ToString)
            upcom.Parameters.AddWithValue("propid", rowid.ToString)
            Try
                upcom.ExecuteNonQuery()
                gridfflistings.Rebind()
                lbldebug.Text = " updated information"
                upcon.Close()
            Catch ex As Exception
                lbldebug.Text = "There was an issue updating the db" & ex.Message
            End Try
        End Using
    End Sub



******the grid*****

<telerik:radgrid id="gridfflistings" datasourceid="sqlfflistings" runat="server" width="800px" OnUpdateCommand="gridfflistings_UpdateCommand" AllowAutomaticUpdates="false">                
                <MasterTableView DataSourceID="sqlfflistings" DataKeyNames="propertyid" AutoGenerateColumns="false" EditMode="EditForms" >
                <columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" >               
                </telerik:GridEditCommandColumn>               
                <telerik:GridBoundColumn HeaderText="Property ID" datafield="propertyid" readonly="true" visible="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Address" datafield="address1" uniquename="address" readonly="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="City" datafield="city" readonly="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn HeaderText="State" DataField="state" readonly="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Zip Code" DataField="Zipcode" readonly="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="M6P ID" DataField="m6plistingid" readonly="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="MLS" DataField="mlsnumber" ReadOnly="true" ></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Direct Link" DataField="directlink" UniqueName="directlink" ColumnEditorID="newlink" Visible="false" ReadOnly="true"></telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="newlink" headertext="Direct Link">
                    <ItemTemplate>
                        <asp:Label ID="lbllink" runat="server"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtlink" runat="server"></asp:TextBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridCheckBoxColumn HeaderText="Paid" DataField="pstatus" readonly="true"></telerik:GridCheckBoxColumn>
                </columns>
                </MasterTableView>
                </telerik:radgrid>

I have changed the code as follows to try and use a custom edit form to see if that would fix the issue. I have done some testing and it is updating data to the db, it is just NOT capturing the data from the edit form. It keeps applying a &nbsp; to the db instead of the values needed. I have altered the code above to the new code, PLEASE HELP! I have to get this function finished TODAY!!!!!!  now when I click the update button it does not leave edit mode. 
Iana Tsolova
Telerik team
 answered on 06 Jun 2011
1 answer
112 views
i have a radtextbox

 <telerik:RadTextBox ID="rtbItemDescription" runat="server" TabIndex="1050"
                                            MaxLength="<%$ Resources:ItemResources,rtbItemDescriptionMaxLength %>"
                                            Width="<%$ Resources:ItemResources,rtbItemDescriptionWidth %>"  
                                            TextMode="MultiLine" Rows="<%$ Resources:ItemResources,rtbItemDescriptionRows %>"                                        
                                             ontextchanged="rtbItemDescription_TextChanged" >
                                        </telerik:RadTextBox>


from resource  file rtbItemDescriptionMaxLength ="160"
                             rtbItemDescriptionWidth ="150"
                            rtbItemDescriptionRows="3"
when i save data by clicking radbutton
control goes to this line in javascript file
b._textBoxElement.select(); error occurs "microsoft javascript error invalid function"
Martin
Telerik team
 answered on 06 Jun 2011
2 answers
93 views
hy everyone , i'm still a noob at telerik controls , i have a project and i want to use the RadScheduler , i used it with a database witch got a table named event(id,text,de(start),a(end)), it works , i mean it shows the events , but just shows , i cant delete , drag or create , and i really dont have an idea how to do , plz if u can help me :S
Plamen
Telerik team
 answered on 06 Jun 2011
3 answers
390 views

How i find in radcombobox in javascript tag ,

<telerik:RadCodeBlock runat="server" ID="radCodeBlock">
        <script type="text/javascript">
            function onSelectedIndexChanged(sender, eventArgs) {
                debugger;
                updateComboBox(sender);
            }

            function updateComboBox(listBox) {
                var text = "";
                var value = "";
                var items = listBox.get_selectedItems();

                for (var i = 0; i < items.length; i++) {
                    var item = items[i];

                    //Check whether the Item's 'selected' attribute is set to true.
                    if (item.get_selected()) {
                        text += item.get_text() + ", ";
                        value += item.get_value() + ", ";
                    }
                }

                text = text.substring(0, text.length - 2);
                value = value.substring(0, value.length - 2);

                var comboBox = $find("ComboBox_SortColumn");

                //Set the text of the RadComboBox to the texts of the selected Items, separated by ','.
                comboBox.set_text(text);

                //Set the value of the RadComboBox to values of the selected Items, separated by ','.
                comboBox.trackChanges();
                comboBox.get_items().getItem(0).set_value(value);
                comboBox.commitChanges();
            }

        </script>
    </telerik:RadCodeBlock>



<EditFormSettings CaptionFormatString="Create" EditFormType="Template">

  <td>
                                                                        <asp:Label ID="Label15" runat="server">Selected</asp:Label>
                                                                        <telerik:RadListBox runat="server" DataTextField="Text" DataValueField="Value" ID="RadListBoxDestinationGroup"
                                                                            AutoPostBackOnReorder="true" EnableDragAndDrop="true" AllowReorder="true" Height="140px"
                                                                            Width="160px" ButtonSettings-Position="Left" OnClientSelectedIndexChanged="onSelectedIndexChanged">
                                                                        </telerik:RadListBox>
                                                                    </td>

<td>
                                                        <telerik:RadComboBox ID="ComboBox_SortColumn" runat="server" Width="175px" SelectedValue='<%# Bind("SortColumn") %>'
                                                            AllowCustomText="true">
                                                            <Items>
                                                                <telerik:RadComboBoxItem Text="" />
                                                            </Items>
                                                        </telerik:RadComboBox>
                                                    </td>
<EditFormSettings/>



Thanks,
Mohamed.
Iana Tsolova
Telerik team
 answered on 06 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?