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

I've created a RadGrid using Client-Side Databinding according to this example:
http://www.telerik.com/help/aspnet-ajax/grid-client-side-binding.html

This is the declaration of my RadGrid:
<telerik:RadGrid ID="Grid" runat="server" Skin="Metro" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowPaging="true" AllowMultiRowSelection="true" PageSize="25" EnableEmbeddedSkins="true">
    <MasterTableView CommandItemDisplay="Top" EditMode="PopUp" ClientDataKeyNames="Id" DataKeyNames="Id" InsertItemPageIndexAction="ShowItemOnCurrentPage">
    <Columns>
            <telerik:GridEditCommandColumn />
            <telerik:GridBoundColumn DataField="Id" HeaderText="Id" UniqueName="Id" Display="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name">
        </Columns>
    </MasterTableView>
    <PagerStyle AlwaysVisible="true">
    </PagerStyle>
    <ClientSettings EnableRowHoverStyle="true">
        <DataBinding Location="~/services/service.asmx"
            SelectMethod="List" SelectCountMethod="ListCount">
        </DataBinding>
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
</telerik:RadGrid>

When I click the Add New Row or Edit button, the Grid calls my webservice, but besides that, nothing happens. No postback or anything else.

Am I missing something here? Is there a way to show the PopUp-form through client-side and should I do that?

Kind regards,

Jesse
Radoslav
Telerik team
 answered on 06 Nov 2012
1 answer
171 views

 

I have a couple of questions as it pertains to JavaScript and Telerik Ajax controls:

1 - How can I reference a control using a variable? For example, I'm using the following code to enable/disable a RadTextBox based on a checkbox:

<script type="text/javascript">
    function enableDisableControl(bEnable) {
        var control = $find("<%= txt_ticketnumber.ClientID %>");
        if (bEnable) {
            control.enable();
        }
        if (!bEnable) {
            control.disable();
        }
    }
</script>

 

I would like to make this more modular by doing this:

<script type="text/javascript">
    function enableDisableControl(bEnable, controlID) {
        var control = $find("<%= controlID.ClientID %>");
        if (bEnable) {
            control.enable();
        }
        if (!bEnable) {
            control.disable();
        }
    }
</script>

 
and then calling it from checkbox's onclick client event.

onclick="enableDisableControl(this.checked, 'txt_ticketnumber');"

It works with standard ASP controls, but when I attempt to do this with Telerik controls I receive a null reference.

2 - How can I access ASP Ajax controls from a imported JavaScript. For example, the 1st example listed above works fine if its in the ASPX file wrapped in a RadScriptBlock. But if I move it to its own file (named something.js) and import it with the following code, I can no longer access controls. Its seems "out of scope". I've also tried wrapping it in a RadScriptBlack with no success.

<script type="text/javascript" src="Scripts/ControlNameLocator.js"></script>


Princy
Top achievements
Rank 2
 answered on 06 Nov 2012
1 answer
247 views
Does RadGrid support filtering by multiple selections such as check boxes (see attached screen shot)? If it does, Can someone provide some sample code for that?
Shinu
Top achievements
Rank 2
 answered on 06 Nov 2012
6 answers
112 views
Hello,

I have a rad grid with property AllowSorting="true". I did set my sort expressions for all my columns. When i sort the columns it is working fine. Now i want to place the focus on the column link which is sorted now or on the asc/desc image button. Please advice me on this.

Thanks,
Syam.
Eyup
Telerik team
 answered on 06 Nov 2012
1 answer
115 views
First I'll post the code.
Here's the javascript code:

     function sortByStatus() {
 
//             var item = eventArgs.get_item();
             //             var strSort = item.get_value();
             var combo = $find("<%= rcbStatus.ClientID %>");
             var comboItem = combo.get_selectedItem();
             var strSort = comboItem.get_value();
             alert('Selected ' + comboItem.get_value());
 
             if (strSort != 'Active') {
                 window.location = 'meet-the-panel.aspx?paneltype=' + strSort;
             } else {
                 window.location = 'meet-the-panel.aspx';
             }
             
     }


<telerik:RadComboBox ID="rcbStatus" runat="server" Skin="Black" EnableEmbeddedSkins="false" Width="220px" >
                <Items>
                    <telerik:RadComboBoxItem Value="Active" Text="Current Panelists"/>
                    <telerik:RadComboBoxItem Value="alumni" Text="Past Panelists"/>                   
                </Items>
</telerik:RadComboBox>

What this is supposed to do is that when an element is selected run the javascript and go to that page. It works for a few times and then my browser errors with this 'SCRIPT445: Object doesn't support this action' and highlights this line: var a=g?new h(g):new h. At first I thought that the function was not mapping to the combobox and setting the onclientselectedindexchanged on the server side and that did nothing.  I tried setting the autopostback to true and tried it from serverside but I instantly got the same error after one selection. Then I thought that it's not grabbing the value from the box, but from the alert it looked like it was working. The only thing left was the windows.location so I commented that out and I don't receive that error anymore. Something is happening with the redirections that is causing this and I have no idea what it could be. I dont know if this helps but we are using custom skins for this combobox.
Princy
Top achievements
Rank 2
 answered on 06 Nov 2012
1 answer
216 views
Hi need a point in the right direction for an example that will help me do what I need.

I have a radcombobox that is multiselect, using templates.  When I select an item, I need to go through and either a) select other items or b) highlight other items with a changed back color. 

Any direction welcome!

What i was doing prior, was the following on selectedindexchanged on a listbox:
Protected Sub ChangeBackColorIfImplied()
      Dim SelectedNum As Integer = -1
      Dim SelectedString As String = ""
      Dim StringofUps As String = ""
      lblUpInfo.Text = ""
      Dim i As Integer
      For i = 1 To lbUp.Items.Count - 1
          If lbUp.Items(i).Selected Then
              StringofUps = StringofUps & lbUp.Items(i).Value
              lbUp.Items(i).Attributes.Add("style", "background-color#FFFFFF")
          End If
      Next i
      Dim Flag As Boolean = False
      Dim mylistitem As ListItem
      For Each mylistitem In lbUp.Items
          Dim ListItemString As String = mylistitem.Value
          If InStr(StringofUps, ListItemString) > 0 Then
              If StringofUps <> ListItemString Then
                  mylistitem.Attributes.Add("style", "background-color:#99FFFF")
                  lblUpInfo.Text = "All entities and people highlighted in light blue will also receive this communication"
              End If
          Else
              mylistitem.Attributes.Add("style", "background-color:#FFFFFF")
          End If
      Next
  End Sub
Princy
Top achievements
Rank 2
 answered on 06 Nov 2012
6 answers
3.4K+ views
Can some one help me with changing font name to Arial and size  to 8pt across a Radgrid control but using Web20 skin?

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 06 Nov 2012
1 answer
73 views
Hi,

In my RadGrid, I've enabled filtering of columns. I need to clear the filter on inserting a new row. How can I do that?

Thanks.
Shinu
Top achievements
Rank 2
 answered on 06 Nov 2012
1 answer
72 views
Hi all,

Could you please provide some suggestions to give color for the CommandItem? 

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 06 Nov 2012
4 answers
171 views
Hi,

I have face an issue on the telerik radeditor whereby the table lines will go missing when i copy and paste the content from a msword document to the telerik radeditor after i save it and redisplay it.

The initialContent.jpg is the screenshot when i copy and paste the content. it looks ok and den i save the content of the radeditor into a database.

After which, when i load the contents back to the radEditor, the table lines had gone missing. Please refer to outcomecontent.jpg.

What might be the cause? is there any possible workaround?

Regards
Eugene Wong
Top achievements
Rank 1
 answered on 06 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?