Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
99 views

i have a rad grid that allows filtering by column.
i found some great code to remove the menu items i don't want - works great. How can i rename the Display
to something else?i can't find anything on that for gradGridColumn Filters. i know how to do it for the regular RadFilters, but not these guys. 
thanks
rik 

GridFilterMenu
menu = MoveInvItemsRadGrid.FilterMenu;

int i = 0;

while (i < menu.Items.Count)

{

if (menu.Items[i].Text == "NoFilter" | menu.Items[i].Text == "StartsWith" | menu.Items[i].Text == "Contains" | menu.Items[i].Text == "EqualTo" | menu.Items[i].Text == "GreaterThan" | menu.Items[i].Text == "LessThan")

{

i = i + 1;

}

else

{

menu.Items.RemoveAt(i);

}

}

Mira
Telerik team
 answered on 21 Jul 2011
1 answer
173 views
I have set up a radGrid for editing in PopUp mode. In the main grid I have customized both the header text and the DisplayFormatString of several columns. Everything looks good there. What I am noticing is that when the edit form shows up, the labels for the field controls are showing correctly BUT the DataFormatString is no longer being applied (date should be showing the short date format, and they incorrectly show the time as well).

So, I am wondering two things:

1.) Can you customize the DisplayFormatString of the dynamically created EditForm control content?
2.) Is it possible to substitute more "intelligent" controls for the textboxes that the EditForm uses? For example, I would like to use radDatePicker  controls for date input. 

I already know about creating completely custom templates - but am trying to find ways to accomplish the items above without essentially having to code the Edit form from scratch.

Ideas?
Princy
Top achievements
Rank 2
 answered on 21 Jul 2011
1 answer
111 views
Is it possible to enable sorting of a radrating control in a template column using a rad grid populated with a sqlDataSource?
Princy
Top achievements
Rank 2
 answered on 21 Jul 2011
1 answer
126 views
We are using Radrotator as follows:

<telerik:RadRotator ID="RadRotator_Slider" PauseOnMouseOver="false" runat="server" Skin="cms" EnableEmbeddedSkins="false">

 

<ItemTemplate>

 

<asp:Image ID="Image" runat="server" style="cursor:pointer" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Image") %>' AlternateText="" />

 

</ItemTemplate>

 

</telerik:RadRotator>

When Item is clicked, the following event is called and a redirection to
specified URL is executed:

 

Protected Sub RadRotator_Slider_ItemClick(o As Object, e As RadRotatorEventArgs) Handles RadRotator_Slider.ItemClick

Dim dt As DataTable = Session("DataSource")

Dim frame As RadRotatorItem = e.Item

Dim index As Integer = frame.Index

Dim Link As String = dt.Rows(index).Item("LinkAdress")

If Link <> "" Then Response.Redirect(Link)

End Sub


For some specific items, there is no URL. For those items, I would like to disable the
itemclick event and if possible, I would also like to change the cursor style when hovering
over the image back to normal. As a result, no postback action should be executed on items without url.

Is that possible?

Shinu
Top achievements
Rank 2
 answered on 21 Jul 2011
1 answer
217 views
Not sure what is wrong with this, could anyone please help? OnSelectedIndexChanged does not seem to get fired at all. 

Thanks


CS
protected void RadComboBox_StatusList_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
    SetMessage("Hello");
}

ASPX
<telerik:RadComboBox ID="RadComboBox_StatusList" runat="server" DataSourceID="StatusList"  AutoPostBack="true" OnSelectedIndexChanged="RadComboBox_StatusList_SelectedIndexChanged"
    DataTextField="Status" DataValueField="StatusID"
    SelectedValue='<%#Bind("StatusID") %>'>
</telerik:RadComboBox>

Princy
Top achievements
Rank 2
 answered on 21 Jul 2011
1 answer
188 views
I have dynamically added RadGrid on a RadWindow using a ITemplate. I cant get ItemInsert event to fire.
I image something with the initialization is not correct i.e. base.OnInIt(e);. Could it be the problem ?

Here is my code:

void ITemplate.InstantiateIn(Control owner)
        {
            RadGrid rg = new RadGrid();
            rg.ID = "UserManagementTemplateGrid";
            rg.Width = 600;
            rg.Skin = "Default";
            rg.NeedDataSource += new GridNeedDataSourceEventHandler(rg_NeedDataSource);
           
            rg.RegisterWithScriptManager = true;
            rg.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
            rg.ShowHeader = true;
            rg.AutoGenerateColumns = false;
            rg.AutoGenerateEditColumn = false;
            rg.AllowAutomaticInserts = true;
            rg.AllowAutomaticUpdates = true;
            rg.AllowAutomaticDeletes = true;
            rg.AllowSorting = true;
            rg.PageSize = 10;
            rg.AllowPaging = true;

            rg.MasterTableView.Name = "MasterTableView";
            rg.MasterTableView.EditMode = GridEditMode.InPlace;
            rg.MasterTableView.DataKeyNames = new string[] { "ID", "UserName", "Password", "Email", "UserTypeID", "Active" };

            rg.MasterTableView.Columns.Add(AddBoundColumn("ID", "ID", false));
            rg.MasterTableView.Columns.Add(AddBoundColumn("UserName", "User name", true));
            rg.MasterTableView.Columns.Add(AddBoundColumn("Password", "Password", true));
            rg.MasterTableView.Columns.Add(AddBoundColumn("Email", "Email", true));
            rg.MasterTableView.Columns.Add(
                AddTemplateDropDownListColumn("UserTypeID", ListTypes.UserType, "Type", "UserTypeName", "UserTypeID")
            );
            rg.MasterTableView.Columns.Add(
                AddTemplateDropDownListColumn("Active", ListTypes.Active, "Active", "Active", "Active")
            );

            GridEditCommandColumn gecc = new GridEditCommandColumn();
            gecc.UniqueName = "EditCommandColumn";
            gecc.ButtonType = GridButtonColumnType.ImageButton;
            gecc.EditText = "Edit";
            gecc.UpdateText = "Save";
            gecc.CancelText = "Cancel";
            gecc.InsertText = "Add new";
            rg.MasterTableView.Columns.Add(gecc);

            rg.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
            rg.MasterTableView.CommandItemSettings.AddNewRecordText = "Add new";
           
            //grid events
            rg.ItemInserted += new GridInsertedEventHandler(rg_ItemInserted);
            rg.ItemUpdated += new GridUpdatedEventHandler(rg_ItemUpdated);
            rg.ItemDeleted += new GridDeletedEventHandler(rg_ItemDeleted);
            rg.InsertCommand += new GridCommandEventHandler(rg_InsertCommand);

            //Adding RadGrid to Control
            owner.Controls.Add(rg);
        }

void rg_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            RadGrid rg = (RadGrid)sender;
            rg.DataSource = User.GetUsers;
        }

void rg_ItemInserted(object sender, GridCommandEventArgs e)
        {
            throw new NotImplementedException();
        }

Princy
Top achievements
Rank 2
 answered on 21 Jul 2011
1 answer
174 views
Hi, I would like to be able to localize the text of the buttons inside the confirmdialog when a user deletes a record from the grid. Is this possible?

 Attached is a picture of what i am talking about

Thanks
Princy
Top achievements
Rank 2
 answered on 21 Jul 2011
3 answers
127 views
Hi,

I have a RadGrid with an EditItemTemplate and a DetailTable. I would like for the detail to be displayed when I edit an item, and have the following code in my ItemCommand event:
switch (e.CommandName)
{
    case RadGrid.EditCommandName:
        e.Item.OwnerTableView.IsItemInserted = false;
        e.Item.Expanded = true;
        break;
    case RadGrid.InitInsertCommandName:
        // Cancel any edit form
        foreach (GridItem item in e.Item.OwnerTableView.Items)
        {
            if (item is GridEditableItem)
            {
                GridEditableItem ei = item as GridEditableItem;
                ei.Edit = false;
            }
        }
        break;
    default:
        break;
}

But when I click edit, the form is displayed but the item does not expand. I have checked that no other code is being executed that might do a Rebind().

Any reason this might be happening?

ROSCO
Lucania
Top achievements
Rank 1
 answered on 21 Jul 2011
1 answer
97 views
Hi Folks,

We just dropped an empty combo box on our page and it looks like the attached file:

We then created a completely new web app and new blank page and the combo box looks normal.

One thing we noticed is that intellisense isn't working in the existing page with the wonky render.

Any suggestions as to where to start looking?

Thanks!


Robert
Top achievements
Rank 1
 answered on 20 Jul 2011
1 answer
82 views
It works fine when editing an existing node, but when adding a new node and setting startEdit for that node it doesn't fire the server side NodeEdit event after entering the new text.

Adding the new node appears ok on the client side, it gives me a new node and goes into edit, but I never hit the server NodeEdit handler.  I have postback disabled on the context menu for Edit and Add specifically to handle those in NodeEdit.

Is there something else I need to specify on the client side to get that node hooked up?

Here is my client side code:

function onClientContextMenuItemClicking(sender, eventArgs)
        {
            var node = eventArgs.get_node();
            var item = eventArgs.get_menuItem();
  
            if (item.get_text() == "Edit")
                node.startEdit();
            else if (item.get_text() == "Add")
            {
                var newnode = new Telerik.Web.UI.RadTreeNode();
                newnode.set_text("New Item");
                node.get_nodes().add(newnode);
                newnode.startEdit();
            }
        }

Marbry
Top achievements
Rank 1
 answered on 20 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?