Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
123 views
I have grids populating a RadPanelBar that are created entirely from the codebehind using advanced data binding. I have a GridEditCommandColumn in this grid. When I click "Edit", ItemCommand is fired followed by EditCommand. At this time, the column displays "Update Cancel". Clicking either of these causes a postback, but ItemCommand does not fire. Nor does UpdateCommand or CancelCommand. As you can see in my .cs, I've attached every command handler I could find trying to find something triggered when I click Update or Cancel with no luck. Any help would be great.

ASPX <!-- 2013.3.1114.40 -->
<telerik:RadPanelBar runat="server" ID="ClientProductPanels" Width="100%" AllowCollapseAllItems="false" ExpandMode="SingleExpandedItem" />

CS
private RadGrid PopulatePanelGrid(string referrer)
{
    RadGrid productGrid = new RadGrid();
    productGrid.AllowPaging = false;
    productGrid.AllowSorting = false;
    productGrid.AllowAutomaticInserts = true;
    productGrid.AllowAutomaticDeletes = true;
    productGrid.AllowAutomaticUpdates = true;
    productGrid.AutoGenerateEditColumn = true;
    productGrid.AutoGenerateDeleteColumn = true;
    productGrid.MasterTableView.AutoGenerateColumns = false;
    productGrid.MasterTableView.EditMode = GridEditMode.InPlace;
    productGrid.ID = referrer;
    productGrid.DeleteCommand += new GridCommandEventHandler(productGrid_DeleteCommand);
    productGrid.CancelCommand += new GridCommandEventHandler(productGrid_CancelCommand);
    productGrid.BatchEditCommand += new GridBatchEditEventHandler(productGrid_BatchEditCommand);
    productGrid.ItemDeleted += new GridDeletedEventHandler(productGrid_ItemDeleted);
    productGrid.ItemCommand += new GridCommandEventHandler(productGrid_ItemCommand);
    productGrid.ItemEvent += new GridItemEventHandler(productGrid_ItemEvent);
    productGrid.ItemInserted += new GridInsertedEventHandler(productGrid_ItemInserted);
    productGrid.ItemUpdated += new GridUpdatedEventHandler(productGrid_ItemUpdated);
    productGrid.InsertCommand += new GridCommandEventHandler(productGrid_InsertCommand);
    productGrid.EditCommand += new GridCommandEventHandler(productGrid_EditCommand);
    productGrid.UpdateCommand += new GridCommandEventHandler(productGrid_UpdateCommand);
    productGrid.ItemDataBound += new GridItemEventHandler(productGrid_ItemDataBound);
    productGrid.ItemCreated += new GridItemEventHandler(productGrid_ItemCreated);
    productGrid.NeedDataSource += new GridNeedDataSourceEventHandler(productGrid_NeedDataSource);
     
        GridCheckBoxColumn checkColumn = new GridCheckBoxColumn();
    checkColumn.UniqueName = "Checked";
    checkColumn.DataField = "Selected";
    checkColumn.ReadOnly = true;
    checkColumn.HeaderStyle.Width = Unit.Pixel(20);
    checkColumn.ItemStyle.Width = Unit.Pixel(20);
    checkColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
    productGrid.MasterTableView.Columns.Add(checkColumn);
 
    GridBoundColumn boundColumn = new GridBoundColumn();
    boundColumn.DataField = "ProductName";
    boundColumn.HeaderText = "Product Name";
    boundColumn.ReadOnly = true;
    productGrid.MasterTableView.Columns.Add(boundColumn);
 
    GridNumericColumn numericColumn = new GridNumericColumn();
    numericColumn.DataField = "Fee";
    numericColumn.HeaderText = "Fee";
    numericColumn.UniqueName = "Fee";
    numericColumn.DataFormatString = "{0:C}";
    numericColumn.DecimalDigits = 2;
    numericColumn.MaxLength = 7;
    numericColumn.NumericType = NumericType.Currency;
    numericColumn.HeaderStyle.Width = Unit.Pixel(110);
    numericColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Right;
    numericColumn.ItemStyle.Width = Unit.Pixel(110);
    numericColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
    productGrid.MasterTableView.Columns.Add(numericColumn);
        
        boundColumn = new GridBoundColumn();
    boundColumn.DataField = "AverageFee";
    boundColumn.HeaderText = "Average Fee";
    boundColumn.DataFormatString = "{0:C}";
    boundColumn.ReadOnly = true;
    boundColumn.HeaderStyle.Width = Unit.Pixel(110);
    boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Right;
    boundColumn.ItemStyle.Width = Unit.Pixel(110);
    boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
    productGrid.MasterTableView.Columns.Add(boundColumn);
 
        boundColumn = new GridBoundColumn();
    boundColumn.DataField = "ProductID";
    boundColumn.ReadOnly = true;
    boundColumn.Display = false;
    productGrid.MasterTableView.Columns.Add(boundColumn);
 
    GridEditCommandColumn editColumn = new GridEditCommandColumn();
    editColumn.ItemStyle.Width = Unit.Pixel(75);
    editColumn.UniqueName = "Edit";
    editColumn.EditText = "Add/Edit Fee";
    productGrid.MasterTableView.Columns.Add(editColumn);
 
    return productGrid;
}

Maria Ilieva
Telerik team
 answered on 22 Jan 2014
1 answer
74 views
 Hi

My issue is, while I have three buttons in one of the radgrid column, I need to show different color for different button as client clicks.
Now the challenge is, I have to do that from client side as I have to avoid the server trip which is around 20*3 = 60 times for 20 row grid.
Now I am getting the buttons and can set text into that but when I use the style.background property thats not working. any help will be highly appreciated.

Thanks,
SAN  
Jayesh Goyani
Top achievements
Rank 2
 answered on 22 Jan 2014
9 answers
150 views
Hello,

I'm using Windows 8.1/IE 11 and the latest Telerik release, Q3 '13, dated 10/14/13 and am seeing a variety of rendering issues w/ the RadListbox control. For example, take a look at the demo page using IE 11:

http://demos.telerik.com/aspnet-ajax/listbox/examples/overview/defaultcs.aspx

Note that the transfer buttons do not render (although the underlying HTML does exist). 

I found this out during development and went back to the demo site to see if I could reproduce, and since I can, figured I'd write it up here. Telerik support - do you see this issue as well? Any updates planned for full IE 11 support?

Thanks,

- Mike
Aneliya Petkova
Telerik team
 answered on 22 Jan 2014
1 answer
78 views
Hi
 i want to export a hierarchial grid to excel. But the child rows are not visible. I have tried expanding the child grid on export, but its not working. Any idea?
Princy
Top achievements
Rank 2
 answered on 22 Jan 2014
1 answer
86 views
Hey ,

I have a .NET 4 web application using Telerik ASP.NET Ajax UI Controls library.
In some pages in my web application Im trying to use RadEditor.

I add this tag to my page : 

<telerik:RadEditor id="radBody" runat="server" ContentAreaMode="Div" />

I add the register rule to my page :
<%@ Register TagPrefix="rad" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

When i load my page the editor is totally broken (see the attached screenshot).

Now I tried anything like add httpHandlers to web.config and add CssFiles tag to the RadEditor tag.
I change some settings in the ConfigFile.xml of the RadEditor and nothing happened , its like the application not aware to the config file or any other css resources of the RadEditor component.

I really need to figure this out ASAP.


Thanks.
Shinu
Top achievements
Rank 2
 answered on 22 Jan 2014
2 answers
242 views
Hello, 

I'm creating self-referencing hierarchy radgrid for menu permission and having some problem with populating data.
I want to display like below

Parent Item 1
- Child Item 1.1
- Child Item 1.2
Parent Item 2
- Child Item 2.1
- Child Item 2.2

After setting parentkeyname and keyname at SelfHierarchySetting, my child items display correctly under respective parent items.
But the problem is that those child items also display at parent level like below

Parent Item 1
- Child Item 1.1
- Child Item 1.2
Parent Item 2
- Child Item 2.1
- Child Item 2.2
Child Item 1.1
Child Item 1.2
Child Item 2.1
Child Item 2.2

How can I get rid of those additional child items instead of using TreeList control?

My data structure is as simple as shown in this help topic http://www.telerik.com/help/aspnet-ajax/grid-self-referencing-hierarchy.html.

I have prepared sample project and you can check below.
.aspx
<telerik:RadGrid ID="RadGrid1" runat="server"
        OnNeedDataSource="RadGrid1_NeedDataSource"
        AutoGenerateColumns="false">
        <MasterTableView AllowSorting="true" DataKeyNames="ID, ParentID" Width="100%">
            <SelfHierarchySettings ParentKeyName="ParentID" KeyName="ID" />
            <Columns>
                <telerik:GridBoundColumn UniqueName="colName" DataField="Name" HeaderText="Menu Name">
                    <ItemStyle Width="100px" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="colDesc" DataField="Description" HeaderText="Description">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings AllowExpandCollapse="true">
        </ClientSettings>
    </telerik:RadGrid>

.cs
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = GetDataTable();
        }
 
        private DataTable GetDataTable()
        {
            DataTable l_Table = new DataTable();
            l_Table.Columns.Add("ID");
            l_Table.Columns.Add("Name");
            l_Table.Columns.Add("Description");
            l_Table.Columns.Add("ParentID");
 
            l_Table.Rows.Add(new string[] { "1", "Menu 001", "Setup", null });
            l_Table.Rows.Add(new string[] { "2", "Menu 002", "Inventory", null });
            l_Table.Rows.Add(new string[] { "3", "Menu 003", "Reports", null });
 
            l_Table.Rows.Add(new string[] { "4", "Menu 004", "User", "1" });
            l_Table.Rows.Add(new string[] { "5", "Menu 005", "Item", "1" });
            l_Table.Rows.Add(new string[] { "6", "Menu 006", "Item type", "1" });
            l_Table.Rows.Add(new string[] { "7", "Menu 007", "UOM", "1" });
 
            l_Table.Rows.Add(new string[] { "8", "Menu 008", "Issuing", "2" });
            l_Table.Rows.Add(new string[] { "9", "Menu 009", "Receiving", "2" });
 
            l_Table.Rows.Add(new string[] { "10", "Menu 010", "Item details report", "3" });
            l_Table.Rows.Add(new string[] { "11", "Menu 011", "Inventory issuing details report","3" });
            l_Table.Rows.Add(new string[] { "12", "Menu 012", "Inventory receiving details report" });
 
            return l_Table;
        }


Thanks in advanced.
Robin
Robin
Top achievements
Rank 2
 answered on 22 Jan 2014
3 answers
391 views
Hi Telerik,

I have a problem with inserting one line break within the paragraph because it did not render as line break <br/>. If I enter 2 line breaks, that is the time it renders <br/>  within the <p> tags.

Please see below for more elaboration:

Below is my telerik radeditor code in markup page (.aspx):

<telerik:RadEditor ID="uscEditor" runat="server" Width="650" ToolsFile="~/EditMailTemplateTools.xml"
                        ContentAreaMode="Div" EditModes="Design" ExternalDialogsPath="~/Controls" DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"
                        LocalizationPath="~/Resources/RadEditor Dialog" ContentFilters="RemoveScripts, ConvertToXhtml, FixEnclosingP">
                        <CssFiles>
                            <telerik:EditorCssFile Value="../../Includes/Styles/EditorStyle.css" />
                        </CssFiles>
                        <ContextMenus>
                            <telerik:EditorContextMenu TagName="A" Enabled="false">
                            </telerik:EditorContextMenu>
                            <telerik:EditorContextMenu TagName="*">
                                <telerik:EditorTool Name="Cut" />
                                <telerik:EditorTool Name="Copy" />
                                <telerik:EditorTool Name="Paste" />
                            </telerik:EditorContextMenu>
                        </ContextMenus>
                    </telerik:RadEditor>


My EditorStyle.css is this:
.reContentArea  /*this selector corresponds to the body selector when RadEditor is in Iframe mode*/
{
    font-family: Verdana !important;
    font-size: 12px !important;
    color: white;
    background-color: #555 !important;
    text-align: left !important;
    word-wrap: break-word !important;
    padding: 3px 15px 3px 15px !important;
}
 
.reContentArea P
{
    margin: 0;
    border: 1px solid #666;
    color: #666;
    font-size: 12px;
    padding: 10px;
}
 
.reContentArea H1
{
    margin: 0;
    border: 1px solid #666;
    color: #000;
    padding: 20px;
}
 
.reContentArea OL
{
    margin-top: 20px;
    list-style-type: lower-roman;
    border: 1px solid #666;
    color: #555;
    padding: 10px 10px 10px 55px;
}
 
.reContentArea table
{
  BORDER-RIGHT: #99ff99 1px dashed;
  BORDER-BOTTOM: #99ff99 1px dashed;
  width:100%;
  margin-top: 20px;
}
 
.reContentArea table td
{
  font-size: 12px !important;
  color: #555;
  PADDING: 3px;
  BORDER-TOP: #99ff99 1px dashed;
  BORDER-LEFT: #99ff99 1px dashed;
  text-align: center;
}
 
.reContentArea img
{
    margin: 1px 1px 1px 1px;
    border: solid 1px blue;
}


so this is the content of the editor being set on page load:
<p><span class="param">[asdadsd]</span><br /><br /></p><p>asdsadaddasd d sffdsfdsfsf, wuweqiwqeiwuicxen period</p><p>Best regards,<br />sadasdasd</p><p>dasadsadsad qwweuic xnnnsansansawqwqi.</p>

Then, I decided to modify the message and click save (see below)

So what I did was I am going to enter line break between the word 'period' and 'Best regards'. So I positioned my cursor at the end of word 'period' and press enter. In the UI, it did show a line break. But after saving it, there is no line break anymore because the html output of the content of the editor is this (which is still the same) :

editor.Content :
<p><span class="param">[asdadsd]</span><br /><br /></p><p>asdsadaddasd d sffdsfdsfsf, wuweqiwqeiwuicxen period</p><p>Best regards,<br />sadasdasd</p><p>dasadsadsad qwweuic xnnnsansansawqwqi.</p>

Even if I position my cursor before the letter B in Best Regards and hit enter, it still does not work.

If I enter 2 line breaks, that is the time it renders <br/>  within the <p> tags.
editor.Content becomes this:
<p><span class="param">[asdadsd]</span><br /><br /></p><p>asdsadaddasd d sffdsfdsfsf, wuweqiwqeiwuicxen period<br /><br /></p><p>Best regards,<br />sadasdasd</p><p>dasadsadsad qwweuic xnnnsansansawqwqi.</p>

Can you help me with this? What should I do to make it work (entering one line break and it will be as such)?

Thank you!

Best Regards,
Ema
Marin Bratanov
Telerik team
 answered on 22 Jan 2014
1 answer
101 views
Hello All,

I have Grid in the main screen, and i am having RadWindow to show popup. Our requirement is,  by default, in the main screen, we are using Blank(Outline) Flag image for opening Rad Window. After closing RadWindow, we want to change the Image Url, i.e., Colored Flag Image. how can we change the Url of Image, which is in Parent Grid Without Refreshing the Parent Grid?

Please have a look at below code:

//Grid Template Column in the Main Screen
 
<telerik:GridTemplateColumn UniqueName="imgTemplateColumn" InitializeTemplatesFirst="false" HeaderStyle-Width="70" HeaderText="Image" HeaderStyle-
                                 SortExpression="Image">
                        <ItemTemplate>
                            <asp:ImageButton ID="imgbOutline" runat="server" ImageUrl="~/Images/flag_outline.png"/>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>


<%-- Declaring RadWindow Pop-up for General Data--%>
                <telerik:RadWindow ID="GeneralData" runat="server" Title="General Data" Height="650px"
                    Width="800px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                    Modal="true" NavigateUrl="frmMainScreen.aspx" Behaviors="Close">
                </telerik:RadWindow>

// To show the GeneralData Popup
            function ShowGeneralDataPopUp(id, t, rowIndex) {
                var grid = $find("<%= grdProduct.ClientID %>");
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);
                window.radopen("popGeneralData.aspx?RecNo=" + id + "&f=" + t + "&RowIndex=" + rowIndex, "GeneralComments");
                return false;
            }

protected void grdProduct_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    ImageButton imgbOutline = (ImageButton)e.Item.FindControl("imgbOutline");       // Getting GeneralComments Link
                imgbOutline.Attributes["href"] = "javascript:void(0);";
                imgbOutline.Attributes["onclick"] = String.Format("return ShowGeneralComments('{0}','{1}', '{2}');", intRecNo, "GeneralData", e.Item.ItemIndex);
 
}

// After Closing the RadWindow the below Javascript method is going to call
 
function CloseAndRebind(args) {
                GetRadWindow().BrowserWindow.refreshGrid(args);
                GetRadWindow().close();
 
    //How can I access ImageButton of Parent Grid
                //parent.document.getElementById(‘imgbOutline’)
 
            }

Please give suggestions, how can we change the Url of Image, which is in Parent Grid Without Refreshing the Parent Grid.

Thanks In Advance.

Konstantin Dikov
Telerik team
 answered on 22 Jan 2014
1 answer
41 views
HI,
    In my case When Page load that times Grids Columns Header and Columns Data are miss-match please find the attachment Image.please provide solution.

My grid code is
 <telerik:RadGrid ID="gv_LeaseProperty1" runat="server" AllowPaging="True" CssClass="rgHeaderDiv"  AllowMultiRowSelection="True" AutoGenerateColumns="False"  onneeddatasource="gv_LeaseProperty1_NeedDataSource" ShowFooter="true" GridLines="None" ShowGroupPanel="True" >
                                                 <ClientSettings AllowDragToGroup="True">
                                                            <Scrolling AllowScroll="true"  UseStaticHeaders="true" SaveScrollPosition="true" />                                                          
                                                 </ClientSettings> 
                                           <MasterTableView>
                                               <Columns>
                                                   <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                                                       <ItemTemplate>
                                                           <asp:CheckBox ID="chk_ItemProperty" runat="server" OnCheckedChanged="chk_ItemProperty_CheckedChanged"
                                                           AutoPostBack="True" />
                                                       </ItemTemplate>
                                                       <HeaderTemplate>
                                                           <asp:CheckBox ID="chk_HeaderProperty" runat="server" OnCheckedChanged="chk_HeaderProperty_CheckedChanged"
                                                           AutoPostBack="True" />
                                                       </HeaderTemplate>
                                                   </telerik:GridTemplateColumn>
                                                 <telerik:GridBoundColumn Display="false" DataField="Property_Id" DataType="System.Int32" HeaderText="Property Id" FilterControlAltText="Filter column column" UniqueName="Property_Id" />
                                                 <telerik:GridBoundColumn DataField="Code" DataType="System.String" HeaderText="Code" FilterControlAltText="Filter column column" UniqueName="Code" />
                                                 <telerik:GridBoundColumn DataField="Title" DataType="System.String" HeaderText="Property Name" FilterControlAltText="Filter column column" UniqueName="Title" />
                                                 <telerik:GridBoundColumn DataField="Area" DataType="System.Decimal" HeaderText="Area" FilterControlAltText="Filter column column" UniqueName="Area" />
                                                 <telerik:GridBoundColumn DataField="Landlord_Name" DataType="System.String" HeaderText="Landlord Name" FilterControlAltText="Filter column column" UniqueName="Landlord_Name" />
                                                 <telerik:GridBoundColumn DataField="TotalParcel" DataType="System.Int32" HeaderText="Total Parcel" FilterControlAltText="Filter column column" UniqueName="TotalParcel" />
                                               </Columns>
                                           </MasterTableView>
                                           </telerik:RadGrid>  
Thanks,
Rahul
Princy
Top achievements
Rank 2
 answered on 22 Jan 2014
1 answer
73 views
Hi,

You might want to consider a modification regarding your css in RadGrid.

Radgrid MetroTouch example, the css is :

.RadGrid_MetroTouch input {
    background-color: #FFFFFF;
    border: 1px solid #CDCDCD;
    color: #000000;
}

It inpacts the skin of a potential RadButton you would like to place in the CommandItemTemplate (for exemple).
It can be solved by adding a cssclass to the button like this 
.RadGrid_CommandItemTemplate input{background-color: rgba(0, 0, 0, 0)!important;border: 0 none!important;} but its a bit annoying.

Regards
Arnaud



Maria Ilieva
Telerik team
 answered on 22 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?