Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
216 views
Hi,
I have a RadGrid which contains Parent Rows and each parent Row has Child Rows(populating Child rows with DetailTableDataBind event).
and i am creating a hyperlink inside the child table
protected void grd_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item.OwnerTableView.Name == "ChildTable" && e.Item is GridDataItem)
       {
         GridDataItem item = (GridDataItem)e.Item;
         string  szID = item.GetDataKeyValue("ID").ToString();
         string szName = item.GetDataKeyValue("NAME").ToString(); 
 
         HyperLink hLink = (HyperLink)item.FindControl("HyperLink1");
         hLink.Text = szName;
 
         hLink.Attributes.Add("onclick", "return onDocClick('" + item.OwnerTableView.ParentItem.ItemIndex + "', '" + item.ItemIndex + "');");
      }
}

Javascript
 function onDocClick(parentindex, childindex) 
 { 
  // here How do i select/check Corresponding Parent Row and Child Row?
 }
Princy
Top achievements
Rank 2
 answered on 15 Jul 2014
5 answers
173 views
Actually I can horizontally increase all
elements width by putting their width in percentage(%). So that in a
normal wide screen(1366x768) the pages are rich with labels and its associated
text-boxes, drop-downs, calendar controls ,text-areas and popups.

But our major clients have huge Desktop Monitors so that the text-box,
drop-downs normal height is 22px and in that huge screens its is not at
all sufficient.

Also Popup windows width & height too have the same issue. Can't resize relatively.
Need a solution please help ASAP.

Thanks in Advance


Please see the attachment
Vargis
Top achievements
Rank 2
 answered on 15 Jul 2014
5 answers
347 views

I have created Telerik Grid like this and item Bound Function also shown like as follows:

Please tell me if I resized the columns then how will I get the width of column present in RadGrid.Please find that telerik Auto Generated Column is set to true.



"

Namespace="Microsoft.SharePoint.WebControls" %>

<%@ Register Assembly="Telerik.Web.UI, Version=2010.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Table runat="server">

<asp:TableRow>

<asp:TableCell>

<telerik:RadGrid ID="gridForPreNewEdit2" AllowPaging="true" ShowFooter="false" runat="server" AutoGenerateColumns="true" GridLines="Both">

</telerik:RadGrid>

</asp:TableCell>

</asp:TableRow>

</asp:Table>

void grdViewForPreview_ItemDataBound(object sender, GridItemEventArgs e)

{

try

{

 

if (e.Item is GridDataItem)

{

GridDataItem item = e.Item as GridDataItem;

SPWeb web = SPContext.Current.Web;

SPList list = web.Lists[new Guid(ddlSrcList.SelectedValue)];

 

SPListItem itemCol = list.Items.Add();

 

var contex = SPContext.GetContext(this.Context, 0, list.ID, list.ParentWeb);

 

foreach (GridColumn column in item.OwnerTableView.RenderColumns)

{

if (column.HeaderText == "Delete")

{

ImageButton btnDeleteFor = new ImageButton();

btnDeleteFor.ID = column.UniqueName;

btnDeleteFor.Enabled = false;

item[column.HeaderText].Controls.Clear();

item[column.HeaderText].Controls.Add(btnDeleteFor);

}

else

{

foreach (ListItem lstItem in lbDisplayedCols.Items)

{

if (lstItem.Text.ToLower().Trim() == column.HeaderText.ToLower().Trim())

{

SPField listField = list.Fields[column.HeaderText];

 

if (listField.Type != SPFieldType.DateTime && listField.Type != SPFieldType.User)

{

Panel pnlForBFC = new Panel();

pnlForBFC.ID = "Field2_" + listField.InternalName;

BaseFieldControl bfc = listField.FieldRenderingControl;

bfc.ID = "Field_" + listField.InternalName;

 

bfc.ControlMode = SPControlMode.New;

 

bfc.EnableViewState = true;

bfc.RenderContext = contex;

bfc.ItemContext = contex;

bfc.IsValid = true;

bfc.Visible = true;

pnlForBFC.Controls.Add(bfc);

pnlForBFC.Enabled = false;

 

item[column.HeaderText].Controls.Clear();

item[column.HeaderText].Controls.Add(pnlForBFC);

}

else if (listField.Type == SPFieldType.User)

{

 

PeopleEditor peopleEditor = new PeopleEditor();

 

item[column.HeaderText].Controls.Clear();

item[column.HeaderText].Controls.Add(peopleEditor);

}

else if (listField.Type == SPFieldType.DateTime)

{

DateTimeControl dtControl = new DateTimeControl();

dtControl.ID = "Field_" + listField.InternalName;

dtControl.Enabled = false;

item[column.HeaderText].Controls.Clear();

item[column.HeaderText].Controls.Add(dtControl);

}

 

}

}

}

}

}

else if (e.Item is GridFooterItem)

{

GridFooterItem itemForFooter = e.Item as GridFooterItem;

foreach (ListItem chosenListCol in lbDisplayedCols.Items)

{

if (ViewState[chosenListCol.Text] != null)

{

Label lblForFooter = new Label();

lblForFooter.ID = "Field_" + chosenListCol.Text;

lblForFooter.Text = "0";

lblForFooter.Width = Unit.Percentage(100);

lblForFooter.BorderColor = Color.Black;

lblForFooter.BorderStyle = BorderStyle.Solid;

lblForFooter.BorderWidth = 1;

itemForFooter[chosenListCol.Text].Controls.Clear();

itemForFooter[chosenListCol.Text].Controls.Add(lblForFooter);

}

}

}


Pavlina
Telerik team
 answered on 15 Jul 2014
1 answer
101 views
hello telerik,

I have radgrid with number of columns. there is an option to not display all the column on page load. In case of setting display=none to part of them, the grouping operation misses up the column's width. This is not happening if all the columns are displaying and it's happening only in ie10.
 the optional columns are: UserNameColumn,OUNameColumn, PendingUserApprovalColumn, SelectionColumn, MenuColumn

this this the Grid: 
<bks:BksGrid  runat="server" ID="gridUsersCertifications" AutoGenerateColumns="false" OnItemCreated="gridUsersCertifications_OnItemCreated" OnItemDataBound="gridUsersCertifications_OnItemDataBound" OnPreRender="gridUsersCertifications_PreRender" ShowGroupPanel="true" OnNeedDataSource="gridUsersCertifications_OnNeedDataSource" ExtraHeight="55"  AllowMultiRowSelection="true">
    <MasterTableView AllowSorting="false" GroupLoadMode="Client" TableLayout="Fixed" DataKeyNames="UserCertificationID,BE_OriginatedIN,AcquiringStatusID" ClientDataKeyNames="UserCertificationID,BE_OriginatedIN,AcquiringStatusID"  >
     
        <Columns>
            <telerik:GridClientSelectColumn UniqueName="SelectionColumn" ItemStyle-Width="35px" ></telerik:GridClientSelectColumn>
            <telerik:GridTemplateColumn Groupable="false" UniqueName="MenuColumn" ItemStyle-Width="30px">
                <ItemTemplate>
                    <img src="/Images/Edit.png" alt="" onclick="javascript:OpenMenu(event,'<%#Eval("UserCertificationID") %>','<%#Eval("AcquiredCertificationStatusID") %>','<%#Eval("AcquiringStatusID") %>','<%#Eval("AllowUpdateByUser") %>')"/>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="IDColumn" Display="false" DataField="UserCertificationID"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="UserIDColumn" DataField="UserID" Display="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="UserNameColumn" DataField="UserName" HeaderText="CERTIFICATION_USER_NAME"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="OUIDColumn" DataField="BE_OriginatedIN" Display="false"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="OUNameColumn" HeaderText="CERTIFICATION_OU" SortExpression="ParentName" GroupByExpression="ParentName Group By ParentName" >
                <ItemTemplate>
                    <span class="spanFullPath">
                        <bks:BksLabel runat="server" ID="lblOuName" Text='<%#Eval("ParentName") %>'></bks:BksLabel>
                    </span>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="CertificationIDColumn" DataField="CertificationID" Display="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="MDTypeName" DataField="MDTypeName" HeaderText="CERTIFICATION_TYPE_NAME" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="MDTypeID" DataField="MDTypeID" Display="false" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="CertificationNameColumn" DataField="CertificationName" HeaderText="CERTIFICATION_NAME"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="StatusColumn" HeaderText="CERTIFICATION_STATUS" SortExpression="CertificationStatus" GroupByExpression="CertificationStatus Group By CertificationStatus">
                <ItemTemplate>
                    <span class="spanStatus"><img runat="server" id="imgStatus" alt="" src="" /></span>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="CalculatedExpirationDateColumn" DataField="CalculatedExpirationDateFormat" HeaderText="CALCULATED_CERTIFICATION_EXPIRATION_DATE"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="OriginalExpirationDateColumn" DataField="OriginalExpirationDateFormat" HeaderText="ORIGINAL_CERTIFICATION_EXPIRATION_DATE"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="PlannedStartDateColumn" DataField="PlannedStartDateFormat" HeaderText="CERTIFICATION_PLANNED_START_DATE"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="PlannedAcquiringDateColumn" DataField="PlannedAcquiringDateFormat" HeaderText="CERTIFICATION_PLANNED_ACQUIRING_DATE"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn Groupable="false" UniqueName="acquiringStatusColumn" HeaderText="CERTIFICATION_ACQUIRING_STATUS" >
                <ItemTemplate>
                    <span class="spanApprovalProcess">
                        <bks:BksLabel runat="server" ID="lblacquiringStatus" Text='<%#Eval("AcquiringStatus") %>'></bks:BksLabel>
                    </span>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="AcquiringMethodColumn"  DataField="acquiringMethod" HeaderText="CERTIFICATION_ACQUIRING_RENEWAL_METHOD"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="InitialAcquirementDateColumn" DataField="InitialAcquirementDateFormat" HeaderText="CERTIFICATION_INITIAL_ACQUIREMENT_DATE"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="PendingUserApprovalColumn" Visible="false" HeaderText="CERTIFICATION_PENDING_FOR_USER_APPROVAL" >
                <ItemTemplate>
                    <img runat="server" id="imgPendingUserApproval" alt="" src="/Certifications/Images/PendingApproval.png" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
 
    <ClientSettings AllowGroupExpandCollapse="True" AllowDragToGroup="True" >
        <ClientEvents OnRowMouseOver="GridRowMouseOver" OnRowSelecting="GridUsersCertifications_OnRowSelecting" />
    </ClientSettings>
 
    <GroupingSettings ShowUnGroupButton="true" />
 
    <CommandButtons>
         <bks:BksButton ID="btnUpdateCertification" runat="server" Text="UPDATE_CERTIFICATIONS" OnClientClick="UpdateMultiCertifications()" />
    </CommandButtons>
 
</bks:BksGrid>


thanks in advance,  Shir.

Venelin
Telerik team
 answered on 15 Jul 2014
9 answers
425 views
When we increase the height of the Rad Button its looses its border bottom.
(Default Height 22px ..we cant increase 1px ie 23px bottom border line will disappear)

Please find the attached Image.
Bozhidar
Telerik team
 answered on 15 Jul 2014
7 answers
324 views
Hi 

I have a grid button(linkbutton) , that I want to show a password from a data source after I click it.

So I need to change the GridButtonColumn to a GridBoundColumn after the button is clicked, is this possible?

The I want to change it to a GridBoundColumn becuase I need the DataField and HeaderText properties.

Help would be much appreciated.

Grant.
Princy
Top achievements
Rank 2
 answered on 15 Jul 2014
1 answer
93 views
Hi all,

I am facing a strange issue, with telerik RadEditor control.

If I use only RadEditor on the page, it is working fine. But whenever RadGrid renders on that same page then RadEditor becomes non-funtional. Even I have set its content property with proper html but it is not displaying anythings. Even its design views and preview buttons are also not working.

Please let me know what I need to do to make them work successfully?

Many Thanks.

Asif Javaid
Ianko
Telerik team
 answered on 15 Jul 2014
9 answers
238 views

I have a production application that users intermittently report getting a SYS not defined error on, and the radEditor fails to paint.  I know there are various reasons for getting this error, but most of them are all setup related and would not apply for an intermittent occurrence.  Any hints on how to track this down?  It is not related to the user’s computer because everything is fine most of the time for the users who have reported this issue.

Ianko
Telerik team
 answered on 15 Jul 2014
15 answers
3.3K+ views

I was wondering if someone could explain to me how to get the datakeyvalue of a selected row on the server side and outside of a radgrid event. 

For instance say I have a radgrid and it has a row that has been selected.  When someone clicks a button (called btnTest for instance) that is somewhere else on the page, how do I go about getting the datakeyvalue of the selected row in btnTest’s click event.

THANGARAI
Top achievements
Rank 1
 answered on 15 Jul 2014
1 answer
117 views
Hi Telerik team,

I have implemented a plugin in the document manager popup window which allow us to download files from other resources . When I click the plugin, it will open a Radwindow and download files in the Radwindow control. I try to refresh the file and folder panel after I close the Radwindow.

Any idea how could I refresh it?

Thanks in advance!

Lan
lan luo
Top achievements
Rank 1
Iron
 answered on 14 Jul 2014
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?