Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
417 views

hi I have a RadGrid bound to an openaccess data source on the radgrid

 

_UpdateCommand event I want to save the text value of a combobox not the selected value because we have allowcustomtext on the dropdown set to true

we are useing a "GridDropDownColumn" in the grid, have "radComboBox.AllowCustomText = true" in the Itemdatabound event, and now I am getting the value with "ExtractValues" method in the _UpdateCommand event

Hashtable values = new Hashtable();
gridEditableItem.ExtractValues(values);
values["School"] = radComboBox.Text;

 

I am just not sure how to get the orm to save the changed value?

I tried this but that did not work

gridEditableItem.UpdateValues(values);

what am I missing?

 

 


 

 

 

 

 

 

 

 

 

 

 

 

 

Pavlina
Telerik team
 answered on 13 Apr 2012
1 answer
179 views
I have a radgrid bound to a sqldatasource, I have the columns using a radcombobox. What I want to do is switch some of the columns to use checkboxes like on this example:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/templates/defaultcs.aspx 
The only other thing I've been able to find on this is from this forum from 2009:
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-filtering-using-a-radcombobox-of-checkboxes.aspx 

But first mine is all declared in the aspx file, and second everything else is changing the filter using a js call like:
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("CustomerName", args.get_item().get_value(), "EqualTo");

While that forum post ends with a:
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("ContactTitle," + text ); 
That calls a function on the code behind:
private void RadAjaxManager1_AjaxRequest(object  sender, AjaxRequestEventArgs e) 
 
  if(e.Argumnet.ToString().Split[','][0]=="ContactTitle"
    { 
     //Access the rest of the string and set the filter Expression 
     
    } 
}  

What is the best way to do what I'm trying to do, and if that's the only way to do the checkboxes (using the ajax call) how do I modify the sqldatasource from the ajax call so that it doesn't mess up the rest of the filtering?

Update:
I created a control that inherits from GridTemplateColumn,
In there I do:
RadComboBox rcBox = new RadComboBox();
            rcBox.ID = "DropDownList_" + DataField;
            rcBox.AutoPostBack = true;
            rcBox.DropDownWidth = DropDownWidth;
            rcBox.Width = FilterControlWidth;
            rcBox.CheckBoxes = true;
            rcBox.ItemChecked += rcBox_ItemChecked;
            rcBox.Height = Unit.Pixel(200);
 	    DataTable table = GetDataTable(string.Format("SELECT DISTINCT cast({0} as varchar) as {0} FROM {1} Where 1=1 {2} order by {0} asc"this.DataField, TableName, where));
            rcBox.DataTextField = this.DataField;
            rcBox.DataValueField = this.DataField;
            rcBox.DataSource = table;
            cell.Controls.Add(rcBox);

my rcBox_ItemChecked looks like this:
private void rcBox_ItemChecked(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter"new Pair());
        }

in the:
protected override void SetCurrentFilterValueToControl(TableCell cell)
and:
protected override string GetCurrentFilterValueFromControl(TableCell cell)
How can I access the checkboxs?
And how do I add or filtering best?
Pavlina
Telerik team
 answered on 13 Apr 2012
1 answer
95 views
G'Day Guys,

I have been asked to place a copyright notice in small lettering on the very bottom right of each chart.

Should be a simple thing to put some text down there, but I am struggling to find out how to do it.  If it were within the plot area then I gather I could use markedzones, but even reading through the examples I do not see a clear way to put text on the chart using marked zones.  I followed the demo and I can make lovely colorful back strips ..... not what I need right now though.

1.  How can I add something like "Copyright 2012, XYZ Company" to the bottom right hand corner of the chart.
2. If it can't go on the bottom can you show me a simple example of placing text on the plot area.

Many thanks in advance.

Attatched a pic to show what I want, follow the red arrow :).

Cheers

Ian.
Yavor
Telerik team
 answered on 13 Apr 2012
6 answers
175 views
Does anyone know how to refresh the get_count() value after removing a menu item on client side?
I use the following to remove the menu header item after the last child item is removed but the get_count() function keeps returning the maximum amount of child items that were created by get_items().add(...).

Here is the code I use:

function AddNewMenuItem(itemText,itemValue) {
    var menu = $find(MainMenu_ID);
    var menuTabsItem = menu.findItemByText("Tabs");
    var menuItem = new Telerik.Web.UI.RadMenuItem();
    if (!menuTabsItem) {
        menuItem.set_text("Tabs");
        menuItem.set_value("");
        menu.get_items().add(menuItem);
        menuTabsItem = menu.findItemByText("Tabs");
    }
    menuItem = new Telerik.Web.UI.RadMenuItem();
    menuItem.set_text(itemText);
    menuItem.set_value(itemValue);
    menuTabsItem.get_items().add(menuItem);
}
 
function RemoveMenuItem(itemValue) {
    var menu = $find(MainMenu_ID);
    var menuTabsItem = menu.findItemByText("Tabs");
    var menuTabsItemToRemove = menu.findItemByValue(itemValue);
    if (menuTabsItem) {
        alert("a " + menuTabsItem.get_items().get_count())
        menu.get_items().remove(menuTabsItemToRemove);
        alert("b " + menuTabsItem.get_items().get_count())
        if (menuTabsItem.get_items().get_count() == 0) {
            menu.get_items().remove(menuTabsItem);
        }
    }
}

It works to add and remove items under the item "Tabs" but when a child item is removed from the menu "Tabs" the get_count() returns the same value for point "a" and point "b" in the alert functions of RemoveMenuItem. Just to make myself clear, the item does get removed as expected.
Ioannis
Top achievements
Rank 1
 answered on 13 Apr 2012
1 answer
136 views
We are evaluating various html editor control and telerik is one of them. So far we have found telerik html editor to be very impressive viz-a-viz other vendors out there. There is one important feature we are looking for, seems to be missing from telerik is populating custom drop down from client side. This could be a make or break a deal kind of situation for us. To give you more details, here is the scenario. 

We have a page that has multiple tabs on it, one of the tabs accepts contact list, the list is a tabular screen, so users can enter multiple contacts, in this case all the operations are done on client side, the information is still not persisted on database. There is a second tab in which we show HTML Editor and we need a custom drop down. This custom drop down will show first and last name from the contact list that is populated by users on first tab page screen. As you can make out , the site is highly dynamic and doesn't do a round trip to server. 

We looked at this sample - http://demos.telerik.com/aspnet-ajax/editor/examples/customdropdowns/defaultcs.aspx 

But they are all populated from server side, in our case, we need to populate drop downs from client side. Would appreciate if anyone from telerik could shed a light on this issue, because our telerik evaluation has hit a roadblack. 

Cheers
Yogesh 
Rumen
Telerik team
 answered on 13 Apr 2012
1 answer
68 views
Hi,

Wondering if you can have different ascx forms for inserting informaiton and updating information, becuase sometimes I do not want they to update all the information but only certain portions.  Is there a way to do via ascx pages or inline with the grid as well.

Thanks
Princy
Top achievements
Rank 2
 answered on 13 Apr 2012
2 answers
93 views
Is there a way i can attach one of my grid commands (In this case update all) to a standard radbutton? I can't find any info on this so your help would be greatly appreciated.
Shinu
Top achievements
Rank 2
 answered on 13 Apr 2012
1 answer
98 views
How can i show some values in template text box on page load (not from db).
Thanks............................
Shinu
Top achievements
Rank 2
 answered on 13 Apr 2012
9 answers
263 views
Hello,
I want to execute some when the client click on "Add New Record".
I'm build a template column. I need set text properties of this control by default "7".
If the client want to change it then it's allowed to change.

Source Code : 
<telerik:RadGrid ID="grdSettlement" runat="server" AllowFilteringByColumn="True" CellSpacing="0" DataSourceID="SqlDataSource1" GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticUpdates="True" AutoGenerateColumns="False" AllowAutomaticInserts="true" OnInsertCommand="grdSettlement_InsertCommand">
 
Column Source Code :
 
<telerik:GridTemplateColumn DataField="NO" FilterControlAltText="Filter NO column"
                HeaderText="NO" SortExpression="NO" UniqueName="NO" DataType="System.Int64">
                <InsertItemTemplate>
                    <telerik:RadNumericTextBox runat="server" ID="No">
                    </telerik:RadNumericTextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <%# Eval("NO") %>
                </ItemTemplate>
            </telerik:GridTemplateColumn>


So, for this I want to set the text of RadNumericTextBox "7".
Help me to Solve this...
Shinu
Top achievements
Rank 2
 answered on 13 Apr 2012
0 answers
73 views
Hello, I have been trying to add a list with the following items

NAME
ADDRESS
SITE
So basically i created a List<string> srs  = new List<string>(); and bind it to the RadListView, but i dont understand how all that javascript and what other things i need to make this list draggable to a RadEditor, for example when the user drags NAME into the RadEditor it should add
[[NAME]] to the editor so it will look like this

The customer [[NAME]] has bought 10 items and they will be shipped to [[ADDRESS]] .

Thats how i need it to read in the editor so , if i drag NAME it should add that [[NAME]], this is to create templates. But to be honest.. I dont quite understand what i need from this example, i am lost. Any help would be much appreciated (to many things to track, javascript, etc.. and all those functions with the music stuff confuses me). I am new to the developing workd so would appreciate a simpler example.

http://demos.telerik.com/aspnet-ajax/listview/examples/itemdragdrop/defaultcs.aspx 
Edwin
Top achievements
Rank 1
 asked on 13 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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?