Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
272 views
Hi

I've created a Row mouseover popup with jquery here :- http://trijewels.com/LooseDiamonds.aspx
I want to do the same thing using Telerik controls.
I am new to telerik and need help.

Thanks
Vikas Rana
Shinu
Top achievements
Rank 2
 answered on 09 Jan 2012
2 answers
197 views
Hi,

  I want to export panel into pdf.
  Panel contains radgrid, radcombobox, raddatepicker.
  successfully export the grid but i got a long message in pdf for radcombobox and raddatepicked
//
Sys.Application.add_init(f
unction(){$create(Telerik.
Web.UI.RadComboBox,
{"_dropDownWidth":0,"_h
eight":0,"_skin":"Web20",
"_text":"Section2","_uniqu
eId":"ctl00$ctl00$Secure
PlaceHolder$SchedulerPl
aceHolder$2","_value":"",
"_virtualScroll":false,"clie
ntStateFieldID":"ctl00_ctl
00_SecurePlaceHolder_
SchedulerPlaceHolder_2
_ClientState","collapseAn
imation":"{\"duration\":450
}","expandAnimation":"{\"
duration\":450}","itemDat
a":[{"selected":true},{}],"s
electedIndex":0}, null,
null,
$get("ctl00_ctl00_Secure
PlaceHolder_SchedulerPl
aceHolder_2"));}); //


how to solve this problem...

Thanks
Michael
Top achievements
Rank 1
 answered on 09 Jan 2012
1 answer
79 views
I have a parent child heirarchial grid but I am having issues when I export the grid.

The master records don't start from the first column and seems to be in the end.
I would like the parent records to start from column A and the child records to be indented inside.

Attached is a screenshot and my grid code:

.aspx
 
<telerik:RadGrid ID="rgBeneficiary" runat="server" GridLines="Vertical" AllowPaging="true"
                    AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AutoGenerateColumns="False"
                    EnableLinqExpressions="false" AllowSorting="true" AllowAutomaticDeletes="false"
                    Skin="MBen" EnableEmbeddedSkins="false" DataSourceID="_dataSrcBeneficiaries"
                    AllowCustomPaging="false" AllowFilteringByColumn="true" Width="100%" OnPreRender="rgBeneficiary_PreRender"
                    OnItemCommand="rgBeneficiary_ItemCommand" OnItemCreated="rgBeneficiary_ItemCreated"
                    PageSize="15" ImagesPath="../../App_Themes/MBen/Grid">
                    <MasterTableView TableLayout="Fixed" HierarchyDefaultExpanded="false"
                        HierarchyLoadMode="ServerBind" CommandItemDisplay="Top"
                        ExpandCollapseColumn-CollapseImageUrl="../../App_Themes/MBen/Grid/Collapse.gif"
                        HorizontalAlign="Right" ExpandCollapseColumn-Display="false" RowIndicatorColumn-Display="false"
                        ExpandCollapseColumn-ExpandImageUrl="../../App_Themes/MBen/Grid/Expand.gif">
                        <CommandItemSettings ShowRefreshButton="false" ShowExportToExcelButton="true" ExportToExcelText=""
                            ExportToCsvText="" ExportToPdfText="" ExportToWordText="" ShowExportToPdfButton="true"
                            ShowExportToWordButton="true" ShowExportToCsvButton="true" ShowAddNewRecordButton="false" />
                       <Columns>
                            <telerik:GridTemplateColumn UniqueName="TemplateColumn" AllowFiltering="false" HeaderStyle-Width="3%">
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnCollapse" runat="server" CommandName="ExpandCollapse" ImageUrl="~/App_Themes/MBen/Grid/Collapse.gif"
                                        ToolTip="Collapse" Visible="False " />
                                    <asp:ImageButton ID="btnExpand" runat="server" CommandName="ExpandCollapse" ImageUrl="~/App_Themes/MBen/Grid/Expand.gif"
                                        ToolTip="Expand" />
                                </ItemTemplate>
                                <HeaderTemplate>
                                    <asp:ImageButton ID="ExpandAll" runat="server" CommandName="ExpandAll" ImageUrl="~/App_Themes/MBen/Grid/Expand.gif"
                                        ToolTip="ExpandAll" />
                                    <asp:ImageButton ID="CollapseAll" runat="server" CommandName="CollapseAll" Visible="False"
                                        ImageUrl="~//App_Themes/MBen/Grid/Collapse.gif" ToolTip="CollapseAll" />
                                </HeaderTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="FullName" UniqueName="FullName" HeaderText="Participant Name"
                                CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"
                                FilterControlWidth="125px" FilterControlToolTip="Input name or part of name to search">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EmployeeCode" UniqueName="EmployeeCode" HeaderText="Participant Code"
                                CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"
                                FilterControlWidth="75px" FilterControlToolTip="Input a code to search" />
                        </Columns>
                        <DetailTables>
                            <telerik:GridTableView DataKeyNames="BeneficiaryID" DataSourceID="_dataSrcParticipantBeneficiaries"
                                Width="100%" runat="server" AllowFilteringByColumn="false" ShowFooter="true"
                                HorizontalAlign="Right">
                                <ParentTableRelation>
                                    <telerik:GridRelationFields DetailKeyField="ParticipantID" MasterKeyField="ParticipantID" />
                                </ParentTableRelation>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="BeneficiaryID" UniqueName="BeneficiaryID" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Beneficiary" UniqueName="Beneficiary" HeaderText="Beneficiary Name"
                                        AllowFiltering="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BeneficiaryType" UniqueName="BeneficiaryType"
                                        HeaderText="Beneficiary Type" HeaderStyle-Width="15%">                                       
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BeneficiaryRelationship" UniqueName="BeneficiaryRelationship"
                                        HeaderText="Relationship" AllowFiltering="false" HeaderStyle-Width="15%">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BeneficiaryPercent" UniqueName="BeneficiaryPercent"
                                        HeaderText="Beneficiary Percent" AllowFiltering="false" HeaderStyle-Width="18%">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                    </MasterTableView>                   
                </telerik:RadGrid>

code behind event handlers:

protected void rgBeneficiary_PreRender(object source, EventArgs e)
        {
            if (rgBeneficiary.MasterTableView.Items.Count == 0)
            {
                rgBeneficiary.ShowFooter = false;
            }
             
            RadAjaxManager.GetCurrent(Page).ClientEvents.OnRequestStart = "RequestStart";
        }       
 
        protected void rgBeneficiary_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName.Contains("Export"))
            {
                if (e.CommandName == "ExportToCsv")
                    rgBeneficiary.ExportSettings.ExportOnlyData = false;
 
               rgBeneficiary.MasterTableView.HierarchyDefaultExpanded = true;
            }
 
            #region Expand/Collapse All
 
            if (e.CommandName == RadGrid.ExpandCollapseCommandName)
            {
                (e.Item.FindControl("btnExpand") as ImageButton).Visible = !(e.Item.FindControl("btnExpand") as ImageButton).Visible;
                (e.Item.FindControl("btnCollapse") as ImageButton).Visible = !(e.Item.FindControl("btnCollapse") as ImageButton).Visible;
            }
            if (e.CommandName == "ExpandAll")
            {
                //Looping through each DataItem and making the "btnExpand" image button in the item visibility  to false and  "btnCollapse" visibility to true
                foreach (GridDataItem GridDataItem in rgBeneficiary.MasterTableView.GetItems(new GridItemType[] { GridItemType.Item, GridItemType.AlternatingItem }))
                {
                    ImageButton btnExpand = (ImageButton)GridDataItem.FindControl("btnExpand");
                    btnExpand.Visible = false;
                    ImageButton btnCollapse = (ImageButton)GridDataItem.FindControl("btnCollapse");
                    btnCollapse.Visible = true;
                }
                //Exapanding the DataItem
                foreach (GridDataItem item in rgBeneficiary.Items)
                {
                    item.Expanded = true;
                }
                //Hiding the CollapseAll image in the header to true and ExpandAll image in the header to false
                GridHeaderItem GridHeaderItem = e.Item as GridHeaderItem;
                ImageButton imgCollapseAll = (ImageButton)GridHeaderItem.FindControl("CollapseAll");
                imgCollapseAll.Visible = true;
                ImageButton imgExpandAll = (ImageButton)GridHeaderItem.FindControl("ExpandAll");
                imgExpandAll.Visible = false;
            }
            if (e.CommandName == "CollapseAll")
            {
                //Looping through each DataItem and making the "btnExpand" image button in the item visibility  to true and  "btnCollapse" visibility to false
                foreach (GridDataItem GridDataItem in rgBeneficiary.MasterTableView.GetItems(new GridItemType[] { GridItemType.Item, GridItemType.AlternatingItem }))
                {
                    ImageButton btnExpand = (ImageButton)GridDataItem.FindControl("btnExpand");
                    btnExpand.Visible = true;
                    ImageButton btnCollapse = (ImageButton)GridDataItem.FindControl("btnCollapse");
                    btnCollapse.Visible = false;
                }
                //Collapsing the DataItem
                foreach (GridDataItem item in rgBeneficiary.Items)
                {
                    item.Expanded = false;
                }
                //Hiding the CollapseAll image in the header to false and ExpandAll image in the header to true
                GridHeaderItem GridHeaderItem = e.Item as GridHeaderItem;
                ImageButton imgCollapseAll = (ImageButton)GridHeaderItem.FindControl("CollapseAll");
                imgCollapseAll.Visible = false;
                ImageButton imgExpandAll = (ImageButton)GridHeaderItem.FindControl("ExpandAll");
                imgExpandAll.Visible = true;
            }
            #endregion
        }
 
        protected void rgBeneficiary_ItemCreated(object source, GridItemEventArgs e)
        {
            //removes unwanted line from commanditemdisplay
            if (e.Item is GridCommandItem)
            {
                ((Table)e.Item.Cells[0].Controls[0]).Rows[0].Cells[1].Controls.RemoveAt(1);
            }
        }

Any help is appreciated.
Shinu
Top achievements
Rank 2
 answered on 09 Jan 2012
1 answer
1.0K+ views
I have a grid which I bind to a DataTable in page_load.  I want to programatically select the first row in the grid after I bind the data to the grid - the data binding is done server side by populating a DataTable.  My grid is defined as :-

<telerik:RadGrid ID="gridParts" runat="server" AllowSorting="True" CellSpacing="0" Height="690px" OnSelectedIndexChanged="gridParts_SelectedIndexChanged" AllowMultiRowSelection="False">
<ClientSettings>
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView AutoGenerateColumns="true" TableLayout="Fixed" DataKeyNames="PartNumber" AllowCustomSorting="false" AllowMultiColumnSorting="false" AllowNaturalSort="false" Alloo>
</MasterTableView>
<ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true">
<Resizing AllowColumnResize="true" ResizeGridOnColumnResize="false" AllowResizeToFit="true" ClipCellContentOnResize="true" EnableRealTimeResize="true" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" />
</ClientSettings>
</telerik:RadGrid>

Note that I have enabled selection but disabled multi-row selection.  In my C# I do the following

// Data source for parts grid
gridParts.DataSource = partsTable;

// set initial sorting on the Part Number
GridSortExpression sort = new GridSortExpression();
sort.SortOrder = GridSortOrder.Ascending;
sort.FieldName = "PartNumber";
gridParts.MasterTableView.SortExpressions.AddSortExpression(sort);

// Select the first part (if any)
if (gridParts.Items.Count != 0)
gridParts.Items[0].Selected = true;

What happens now is odd - I don't see any visible sign that the first part has been selected however the grid is in an odd state.  In my gridParts_SelectedIndexChanged handler I have the following code :-

protected void gridParts_SelectedIndexChanged(object sender, EventArgs e)
{
if (gridParts.SelectedItems != null && gridParts.SelectedItems.Count > 0)
{
GridDataItem dataItem = gridParts.SelectedItems[0] as GridDataItem;
string partNumber = (string)dataItem.GetDataKeyValue("PartNumber");
DWPart part = DWPart.FindByName(partNumber);
DisplayComponents(part.ID);
}
}

What is odd is that the partNumber ALWAYS is the first item in the grid, even when I have scrolled down and selected another item.  Simple removing the line which sets the initial selection fixes the problem and the grid selection works correctly - buit I want to always have an item selected as the selected item causes a second grid to be populated.

Princy
Top achievements
Rank 2
 answered on 09 Jan 2012
1 answer
89 views
Hi,

       How can we change the background image/Color of tab strips. i need to change Hover, selected and Tabs normal back ground to color which is matching to our web app. is there any way means please tell me. I tried changed css properties. but the background image is not changing.


Thanks
Rajeev
Princy
Top achievements
Rank 2
 answered on 09 Jan 2012
1 answer
192 views
Please help

I have the following situation:

radgrid with custom template and editmode set to editformtype="template" and editmode="editforms". Also, defined

 

OnUpdateCommand="RadGrid2_UpdateCommand

for the first version and

OnItemCommand="RadGrid1_ItemCommand"

for the second version.

First I put radgrid item in editmode with first button:

RadGrid2.EditIndexes.Add(0);
RadGrid2.Rebind();


On the second button I am trying to bubble grid update from button control that is outside the radgrid like this:
if (commandButton.CommandName.ToLower() == "update")
            {
                foreach (GridEditFormItem item in RadGrid2.MasterTableView.GetItems(GridItemType.EditFormItem))
                {
                   RadGrid2.MasterTableView.PerformUpdate(item, true); // first version
                   item.FireCommandEvent("Update", string.Empty); //second version
                }

The corresponding event handlers bubble but I can`t get values from custom template radtextboxes:

 

<EditFormSettings EditFormType="Template" >
                            <EditColumn UniqueName="EditColumn"></EditColumn>
 <FormTemplate>
                                    <div>
                                        <tr>
                                            <td>
                                                Inicijali
                                            </td>
                                            <td>
                                                <telerik:RadTextBox ID="Inicijali" runat="server" Font-Names="Verdana" Font-Size="Small"
                                                    Text='<%# Bind("Inicijali") %>'>
                                                </telerik:RadTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Kratica imena
                                            </td>
                                            <td>
                                                <telerik:RadTextBox ID="KraticaImena" runat="server" Font-Names="Verdana" Font-Size="Small"
                                                    Text='<%# Bind("KraticaImena") %>'>
                                                </telerik:RadTextBox>
                                            </td>
                                        </tr>.....</table>

RadGrid definition:

<telerik:RadGrid ID="RadGrid2" runat="server" DataSourceID="DetailsViewSQLDataSource"
                        AutoGenerateColumns="false" OnUpdateCommand="RadGrid2_UpdateCommand" OnItemCommand="RadGrid1_ItemCommand"
                        AllowAutomaticUpdates="true">
                        <MasterTableView DataSourceID="DetailsViewSQLDataSource" AutoGenerateColumns="true"
                            DataKeyNames="IdOsobe" ShowHeader="false" EditMode="EditForms" AllowAutomaticInserts="true">

I tried like this:

protected void RadGrid2_UpdateCommand(object sender, GridCommandEventArgs e)
       {
           if (e.CommandName == RadGrid.UpdateCommandName)
           {
               if (e.Item is GridEditFormItem)
               {
                   GridEditFormItem item = (GridEditFormItem)e.Item;
                   int id = Convert.ToInt32(item.GetDataKeyValue("IdOsobe"));
                   if (id != 0)
                   {
                       RadTextBox txtInicijali =
                          (RadTextBox)item.FindControl("Inicijali");
 
                       RadGrid1.Rebind();
                   }
               }
           }
 
       }

But the value of txtInicijali.text is always string.empty.

How can get values from custom template?

Is there a better way to accomplish update from button outside the radgrid?

Another problem that I have:

I have defined <ItemTemplate></ItemTemplate> and <FormTemplate> and grid is in edit mode it shows both templates - does not hide itemtemplate! I want to item template and editformtemplate be the same.


Please help!
Shinu
Top achievements
Rank 2
 answered on 09 Jan 2012
1 answer
33 views
Hi,

How give a parent node an other icon than a plus or minus when it is having no children?
No my treeview is given no icon for items which having no children.

Regards,
Wouter Splinter
Princy
Top achievements
Rank 2
 answered on 09 Jan 2012
1 answer
149 views
HI there,

Screenshot is attached , RadGrid is now showing Add New Record and refresh buttons, and text is also not displaying correctly.
2011-Q3-Nov 
Shinu
Top achievements
Rank 2
 answered on 09 Jan 2012
1 answer
69 views
I have a RadGrid on my page with the Vista theme and there are absolutely no fonts specified anywhere.  So it's just picking up the default fonts (from the theme, I assume).  The fonts seem to be Arial or a variation of it.

When I export the grid to PDF, the fonts on the generated file are Times New Roman.

What do I have to do to have the PDF match the grid?
I am using RadControls for ASP.NET AJAX Q1 2011.
Princy
Top achievements
Rank 2
 answered on 09 Jan 2012
0 answers
95 views
I've read many of the threads on the forum concerning this issue, but they are very confusing and seem to focus on .net 4.

I am trying to use Ajax control toolkit 3.5 (version: 3.5.51116.0) with Telerik version 2010.1.519.35.  I have a masterpage with a RadScriptManager and I'm getting this error:

Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "AjaxControlToolkit.Properties.Resources.resources" was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time, or that all the satellite assemblies required are loadable and fully signed.



Are these two versions not compatible?
Troy
Top achievements
Rank 1
 asked on 08 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?