Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
665 views
Hello,
I have added custom functionality to my RadGrid to persist grid column visibility when user toggles column visibility from "Columns" context menu.
So whenever user comes back to that page, same columns are displayed as last time.

I am applying persisted settings in Grid prerender event by calling following function:
        private void ApplyGridSettings()
        {
            var persistenceHelper = new PersistenceHelper();
            var settings = persistenceHelper.GetGridPersistenceSettings(this.ClientID);
            if (settings != null)
            {
                foreach (var columnSetting in settings.ColumnsSettings)
                {
                    var column = this.Columns.FindByUniqueNameSafe(columnSetting.Column);
                    if (column != null)
                    {
                        column.Display = columnSetting.Visible;
                    }
                }
            }
        }

Now I have added a header context menu "Reset Columns" to remove persisted settings and reset grid columns to default visibility.
I am calling following code on HeaderMenu click:

        private void HeaderContextMenu_ItemClick(object sender, RadMenuEventArgs e)
        {
            switch (e.Item.Text)
            {
                case "Reset Columns":
                    var persistenceHelper = new PersistenceHelper();
                    persistenceHelper.ResetGridColumns(this.ClientID);
                    this.MasterTableView.EnableColumnsViewState = false;
                    this.MasterTableView.Rebind();
                    break;

                default:
                    break;
            }
        }

I thought after rebinding the grid will reset grid columns, but it is not working.
Can anyone please suggest how to reset grid columns visibility?
Konstantin Dikov
Telerik team
 answered on 15 Sep 2016
14 answers
495 views
I have a standard RadListBox setup with 2 List Boxes.   The issue is need to limit the number of items that can be Transferred or Drag and Dropped into RadListBox2 to a maximum of 10 items.   RadListBox1 has a list of up to 100 items.  The issue is I need visitors to be able to pick up to 10, but no more than 10 items from List 1 and put them into List 2.

Is there any way to set maximum number of items on a RadListBox.   Or,  can you suggest javascript to check count and cancel the transfer or DragDrop if the count of the items in ListBox2 > 10 (along with an alert to let the user know what is wrong).

Thanks for any assistance.
Nencho
Telerik team
 answered on 15 Sep 2016
3 answers
485 views
Hai,

i got one problem in radsearcchbox when i select any item in search box OnSearch event will rise and some dropdowns will bind based on Radsearchbox item now i got one problem when i remove that item in Radsearchbox i want to remove all the items in dropdowns 
<cc1:RadSearchBox  runat="server" ID="cmbItemMaster" OnClientDataRequesting="OnClientSearch"
                                       OnSearch="cmbItemMaster_Search" Skin="WebBlue" Style="padding-right: 5px; padding-left: 5px; font-family: Calibri;"
                                               Width="85%" AutoPostBack="true" ZIndex="10000000" DropDownSettings-Width="200px" DropDownSettings-Height="200px">
                                           </cc1:RadSearchBox>
protected void cmbItemMaster_Search(object sender, SearchBoxEventArgs e)
        {
          
                ddlMaterialCode.Items.Clear();
                LoadMaterialCodes(e.Value);
               
            }


when i remove the selected item in radsearchbox the ddlMaterialCode will not show means the dropdown items of ddlMaterialCode is empty and after seleccting radsearchbox item then only it will bind how to do it sir
Peter Milchev
Telerik team
 answered on 15 Sep 2016
3 answers
111 views

Hi,

this Telerik support page claims that I can enable WAI-ARIA support by using the EnableAriaSupport property.

But I cannot find this property on my radPanelBar ASP.NET control (see attachment).

How can I enable WAI-ARIA support for all Telerik ASP.NET controls? (I particularly need it for the TreeView control, too.)

Peter Milchev
Telerik team
 answered on 15 Sep 2016
4 answers
160 views

Hi Telerik support

I want my radlistbox scoll to selected item as code bellow

I test this  code , it was working fire when i click the btnRefresh, pls tell me how to force the radlistbox scroll to selected item after searching finish on RadSearchBox RadIPSearch, after searching, the radlistbox will select the item found, but i want to scroll to it also

Thanks very much

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableScriptCombine="false"></telerik:RadScriptManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">

  <div>
                     <telerik:RadSearchBox ID="RadIPSearch" runat="server"
                            EmptyMessage="Search..." Width="135" OnSearch="RadIPSearch_Search">
                            <DropDownSettings Height="400" Width="200" />
                        </telerik:RadSearchBox>


                        <telerik:RadButton ID="btnRefresh" runat="server" Text="Refresh"
                            OnClientClicked="OnClientClicked"
                            ButtonType="SkinnedButton" AutoPostBack="false" OnClick="btnRefresh_Click">
                        </telerik:RadButton>
                    </div>

                    <div>
                        <telerik:RadListBox ID="lstIPAddress" runat="server"
                            Height="510px" Width="200px" AutoPostBack="True"
                            OnSelectedIndexChanged="lstIPAddress_SelectedIndexChanged">
                            <ButtonSettings TransferButtons="All" />
                        </telerik:RadListBox>
                    </div>

 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

                <script type="text/javascript">
                    function OnClientClicked(sender, args) {
                        var listbox = $find("<%=lstIPAddress.ClientID %>");
                        listbox.get_selectedItem().scrollIntoView();
                    }
                </script>
            </telerik:RadCodeBlock>
    </telerik:RadAjaxPanel>
    </telerik:RadAjaxPanel>

 

 

 protected void RadIPSearch_Search(object sender, SearchBoxEventArgs e)
        {

            if (lstIPAddress.Items.Select(x => x.Text).ToList().Contains(e.Text))
            {
                lstIPAddress.SelectedIndex = lstIPAddress.Items.Where(x => x.Text == e.Text).FirstOrDefault().Index;

                // how to fire radlistbox to scroll to selected item here
            }
       
        }

 

 

Anton
Telerik team
 answered on 15 Sep 2016
1 answer
105 views
Hello !
I use a RadSearchBox like this : http://demos.telerik.com/aspnet-ajax/searchbox/examples/overview/defaultcs.aspx.
And I search to have my result in First or a "auto-scroll" to go to my result.
I tried with onFocus and this code :  var typeSearchBox = $find("<%= RadSearchBox1.ClientID %>");
                                                          typeSearchBox = typeSearchBox.get_inputElement();
                                                           typeSearchBox.focus();

But I don't arrive. Do you have a idea ?
Ivan Danchev
Telerik team
 answered on 15 Sep 2016
4 answers
134 views
I am trying to format my CSV export from a radGrid. It exports fine but it doesn't seem to pick up any of the styles. This what I am using: 

protected void imgBtnExportCSV_Click(object sender, EventArgs e)
  {
    foreach (GridDataItem item in grdLeadList.MasterTableView.Items) //loop through each grid item
      {
        if (item.Selected)
          {
            selectedItems.Add(item.ItemIndex);
          }
      }
 
foreach (GridDataItem item in grdLeadList.MasterTableView.Items)
  {
    // for particuler item
    item["CompanyName"].Font.Name = "Calibri";
    item["CompanyName"].Style["font-size"] = "8pt";
    item["CompanyName"].Style["background-color"] = "#FFF";
    item["CompanyName"].Style["vertical-align"] = "middle";
  }
  grdLeadList.ExportSettings.ExportOnlyData = true;
  grdLeadList.ExportSettings.OpenInNewWindow = true;
                grdLeadList.MasterTableView.Columns.FindByUniqueName("ClientSelectColumn").Visible = false;
            grdLeadList.MasterTableView.Columns.FindByUniqueName("EditCommandColumn1").Visible = false;
            grdLeadList.ExportSettings.FileName = "ColderLeads";
            grdLeadList.MasterTableView.ExportToCSV();
 
  }


Is it possible to format CSV export from radGrid?

Thanks!

Danniel
Top achievements
Rank 1
 answered on 14 Sep 2016
3 answers
245 views

hi all

im working on HIS system and i see its great idea to work with Scheduler to manage doctor's calendar with this perfect tool ,

our doctor calendar build on days in week and it repeated and we have to be able to disable calendar if doctor gone with holidays , there is a duration time for each appointment , its not important to view patients name or id on this calendar all requirement is to view  available time line in available days in week and vacant time  

look forward to hearing from you 

 

 

Peter Milchev
Telerik team
 answered on 14 Sep 2016
5 answers
678 views

Hi

We have "datarow" in class and "dataset" is from ObservableCollection. There are normal set and get for public properties. We use ObjectDataSource to get "dataset" and there are also insert, update and delete commands. All other things seems to work but we have problems with DateTime type properties. Those are tested in GridBoundColumn and GridDateTimeColumn and always same problem. Those are shown correctly with user date format or given datastringformat but when updating or inserting it always crash before our own codes to conversion from "System.String" to "System.DateTime". Only way we have got it work properly is use ISO standard type format "yyyy-MM-dd HH:mm:ss" when setting the value which is not acceptable way to work. So how these datetimes should be set to columns that those are shown and editable in user format and not crash somewhere before it even get to our own code?

Maria Ilieva
Telerik team
 answered on 14 Sep 2016
6 answers
464 views
i am trying to use  telerik:RadGrid but after debugging it giving me error as follows :(

The type or namespace name 'QuickStart' does not exist in the namespace 'Telerik' (are you missing an assembly reference?)


why so??
Rumen
Telerik team
 answered on 14 Sep 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?