Telerik Forums
UI for ASP.NET AJAX Forum
13 answers
619 views
I've been playing with this for a week or so now with no luck.

I have a grid....

<telerik:RadGrid ID="Grid1" AutoGenerateColumns="false" runat="server" Skin="Web20" Width="90%"
            <MasterTableView> 
                <Columns> 
                    <telerik:GridBoundColumn HeaderText="" UniqueName="WDFields" DataField="friendlyname" /> 
                    <telerik:GridTemplateColumn UniqueName="ddHeader" HeaderText="Header"
                        <EditItemTemplate> 
                            <asp:DropDownList ID="HeaderDropDown" runat="server" />                         
                        </EditItemTemplate> 
                    </telerik:GridTemplateColumn> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 

And need to populate the DropDownList (HeaderDropDown) from a seperate datasource than what populates the Grid in general.

Currently, in the code behind, I have...

private void Grid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item.IsInEditMode) 
        { 
            GridEditableItem item = e.Item as GridEditableItem; 
            Dictionary<string, string> dict = new Dictionary<string, string>(); 
            dict = ReadHeader(); 
            DropDownList list = item.FindControl("HeaderDropDown") as DropDownList; 
            list.DataSource = dict
            list.DataBind(); 
        } 
    } 

I have a breakpoint set at the if statement and I'm never stepping into it.

Thanks.


tim
Top achievements
Rank 1
 answered on 01 Apr 2010
0 answers
68 views
Hello,

Anyone know how to use ItemTemplate loaded by xml file.
I need a component asp LoginStatus appear at the end of the menu.

Thanks in advance!


Roberto
Top achievements
Rank 1
 asked on 01 Apr 2010
6 answers
382 views
We are writing a document management system and have encountered some odd behavior when a user hits the 'delete' key and an element is selected (such as a textbox).  What we'd like to do is do a standard confirmation when someone tries to delete a checkbox, textbox, listbox, etc...  We have code on a test page that looks like this:

function

 

OnClientLoad(editor, args)

 

{

editor.attachEventHandler(

"onkeydown", function(e)

 

{

// show the key code for now, later on we'll implement a confirmation
alert(e.keyCode);

e.returnValue =

false;

 

e.cancelBubble =

true;

 

 

return false;

 

});

}


This code is just test code to simply dismiss the keydown event and not do anything.  With this code in place however, if the users selects a textbox, and then presses the delete or backspace key, they element is still deleted.  If I select an element and press another key like 'k' or whatever, then the element is not replaced so I'm not sure what to do.

We also put this code in to trap the enter command and call the 'set_cancel' method to cancel out of an enter keypress

function

 

OnClientCommandExecuting(editor, args)

 

{

alert(args.get_commandName());

 

if (args.get_commandName() == "Enter" || args.get_commandName() == "InsertTab")

 

{

alert(

'cancelling event');

 

args.set_cancel(

true);

 

}

 

}

 
but no command appears to fire when the delete key is pressed so the OnClientCommandExecuting event handler is not hit :(

Any thoughts?

Rumen
Telerik team
 answered on 01 Apr 2010
2 answers
144 views
Hello guys.

I'd like a hint about using tooltip to show messages in some actions (buttons, grid buttons, etc, etc).

I have a page with a tabstrip, that have five tabs. I want to show the tooltip when the user insert, update, delete, etc. I'm trying this:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/webserviceandshow/defaultcs.aspx

but I can't find a way to use only 1 main tooltip in master, because it needs a TargetControlID and I dont know the Id of a button in the grid for example.

What's the best way to do it works?

Thanks in advance.

Regards.
Silvio Silva Junior
Top achievements
Rank 2
 answered on 01 Apr 2010
4 answers
139 views
I am trying to create a custom Ajax control consisting of one radcombo and about 6 text box controls. I want to populate the text boxes with details of the selected item in the rad combo. I have this working with a basic html drop down, the change event on the drop down fires off which access a web service w/ json serialization and it's very simple to update the text boxes. I've declared my control like so:

public class GlnComboPartyPicker : DataBoundControl, IPostBackDataHandler, IScriptControl, INamingContainer//, IPostBackDataHandler//, IDataSource

I later implement the GetScriptDescriptors method:
  IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors() {
      EnsureChildControls();
      ScriptControlDescriptor descriptor = new ScriptControlDescriptor("MyControlNS.MyControl", this.ClientID);

The control renders, the radcompo is populated and scrolls nicely etc.. BUT, normally I would add a handler to a basic html dropdown in the javascript that initializes the client class:
MyControlNS.MyControl.prototype = {
    initialize: function() {
        GLNPartyPickerControl.PartyPicker.callBaseMethod(this, 'initialize');
        $addHandlers(this._partiesDDLElement, { "change": this._selectedPartyChangedHandler }, this);

But since the radcombo isn't a html dom object, I can't attach the event this way and every other thing I've tried has failed. How do I tell the radcombo in my custom control, on the client, what to execute when the radcombo's selected item changes? I don't seem to be able to get a reference to the client side radcombo object. Remember this is a custom control so I need to always reference a function of this, my, control. Thanks !
Keith Thorne
Top achievements
Rank 1
 answered on 01 Apr 2010
2 answers
78 views
I create a rad combo as part of a composit control and it populates normally however when I try to assign eventhandlers client side, it appears the client side events are never raised. I can see the before and after event handlers in the debugger (see below) and they do get assigned. But, when I click on the radCombo and select an item neither of these event handlers executes. What am I missing or what more can I test to find the issue? Thanks!

// the control definition
MyControlNS.MyControl = function(element) {
    MyControlNS.MyControl.initializeBase(this, [element]);
    Sys.Application.add_load(Function.createDelegate(this, MyControlNS.MyControl.onLoaded));
}

// the onLoaded handler
MyControlNS.MyControl.onLoaded = function() {
    debugger;
    $find(this._myControlRadComboClientID).OnClientSelectedIndexChanged = this._tempItemChanged;
    $find(this._myControlRadComboClientID).OnClientDropDownOpening = function() { alert("hello world"); };
}

Keith Thorne
Top achievements
Rank 1
 answered on 01 Apr 2010
1 answer
379 views
Hi,

Not sure if this question is best suited for the Filter or the RadGrid, but I was wondering if there is a way to customize the filter dropdowns. I notice that the dropdown looks a bit like a lot of the popdown menus which show an icon to the left of the text. Is it possible to change these to add in icons similar to what is shown in my attached graphic?

Likewise, is it possible to change the 'T' image itself on the button that drops down the filter list?

I looked at the Style Builder tool but I didn't see anything in there for this..

Thanks in advance!
Iana Tsolova
Telerik team
 answered on 01 Apr 2010
2 answers
79 views
Hi

I am struggling to find the correct syntax to set the selected item of a grid...

I can do it to a list easily enough (lstDtTo.SelectedIndex = 0)

But not on the grid... Can anyone point me in the right direction..?

Thanks..!

Luke
Rudie Chiu
Top achievements
Rank 1
 answered on 01 Apr 2010
3 answers
150 views
Now, understand that I know that when you create a recurring event only the master and any exceptions are stored on the DB.

Now, what I need is to create a treeview of a segment of a scheduler time frame with a node for each event. For regular events that's a piece of cake. What I need to is to be able to create 'dummy' entries to represent the events that Scheduler creates on the fly for recurring events.

So, the question is, given, say, a DB event record, complete with a recurrence rule, is their any way of creating a list of some sort of the events that Scheduler would create? Even if all I got back was a list of start and end datetimes I could prolly work the rest from there.

Even as I type this I'm pretty sure of the answer, but, ever the optimist, I will ask anyway! :-)

Go on, make my day!

--
Stuart
Peter
Telerik team
 answered on 01 Apr 2010
2 answers
98 views
Hello,

I have a ListView  in which I have an EditItemTemplate.  Within that template I have two Combo Boxes that are populated via an ObjectDataSource.  Upon entering edit mode, the fill on the ODS runs twice.  Any way to prevent this from happening?

NY Norton
Top achievements
Rank 1
 answered on 01 Apr 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?