Telerik Forums
UI for ASP.NET AJAX Forum
13 answers
336 views
Hi ,
I am using a RadGrid and i have a RadCombo in one of the column.  That combo has  external call back.

When the radcombo box triggers the selected index changed event of server side.  There in the code behind based on condition
I want to change the focus to either the same combo or next control in the grid. How ever as the page refreshes the i am loosing the focus.  I want IsPostback to be "True" because i have some condition to check in serverside.  And the focus should move to the next control in the grid.

Please tell me how i can achieve this?
Code in server side:
if condition()
{
((RadComboBox)currentEditItem["AmendmentNumber"].FindControl("ddlAmendmentNos")).Focus()
}
else
{

currentEditItem["AmendmentPurpose"].Focus();
((RadTextBox)currentEditItem["AmendmentPurpose"].FindControl("txtPurpose")).Focus();
}

RadCombo Settings:
<rad:GridTemplateColumn UniqueName="AmendmentNumber" DataField="Number" HeaderText="Bylaw #" ItemStyle-Width="10%"><ItemTemplate> <rad:RadComboBox Height="200px" ID="ddlAmendmentNos" MaxLength="10" runat="server" ToolTip="Enter Bylaw Number"AllowCustomText="true" MarkFirstMatch="false" ShowToggleImage="False" SkinsPath="~/RadControls/ComboBox/Skins"Skin="LIComboBoxSkin" ShowMoreResultsBox="true" EnableLoadOnDemand="True" ExternalCallBackPage="AmendmentNosDropDownBox.aspx"OnClientFocus="OnClientFocus" Text='<%# Eval("Number")%>' DataTextField="Number" OnSelectedIndexChanged="ddlAmendmentNos_SelectedIndexChanged"DataValueField="ID" AutoPostBack="true" ShowDropDownOnTextboxClick="false"></rad:RadComboBox></ItemTemplate></rad:GridTemplateColumn>

Regards
Siva Kumar KB
Mira
Telerik team
 answered on 21 Feb 2011
1 answer
34 views
 

 

Yana
Telerik team
 answered on 21 Feb 2011
1 answer
63 views
Hi,

I have set my editor, NewLineBr = "false". 
the HTML is showing correctly but preview for <p> tag doesn't show extra newline.

I have attached a video for your review
http://www.screencast.com/users/charlesXie/folders/Default/media/8203d19c-174c-4f4e-92cb-b63790c732d6

thanks
Charles
Stanimir
Telerik team
 answered on 21 Feb 2011
2 answers
79 views
HI

im using Radmenu.loadxml() to bind my Menu
1)
my menu is having 2 levels with two differnt css function for each level,i..e(.level1{},.level2{})
i want to change the main menu element background-colour when the submenu is hoverd or clicked

2)
display second element of main menu in 2 lines

How to achive these two?Please help.

Thanks
Harin
Kate
Telerik team
 answered on 21 Feb 2011
2 answers
106 views
Hi All,

I have RadChart, which i deployed on SharePoint site.
On mouse over on series, tooltip shows some information.


My issue is that, whenever i hover on SharePoint default search button or Search Textbox, tool-tip gets popup.
As per my understanding, the limit of tool-tip should be inside Chart area not outside.
How can i rid of this tooltip.
Any help will be greatly appriciated.

naimish
Top achievements
Rank 1
 answered on 21 Feb 2011
3 answers
111 views
Hi

The below javascript code snippet is not working in firefox but its working in IE.  Through this I am trying to enable/disable few clientselectcolumn of telerik rad grid based on some conditions.

for (i = 0; i < items.length; i++)

{

 

    items[i].get_cell("ClientSelectColumn").disabled = true;

}

 

 

 

dotnet
Top achievements
Rank 1
 answered on 21 Feb 2011
5 answers
171 views
Hi I'm tring to do a disctinct combobox in edit mode in a radgrid but whit no result.
My code is based on the example EditOnDblClick.
Any help would be apreciated.
Thanks in advance

<

 

 

telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" Width="97%" ShowStatusBar="True" AllowSorting="True" PageSize="14" GridLines="None" AllowPaging="True" runat="server" AllowAutomaticUpdates="True" AutoGenerateColumns="False" OnItemDataBound="RadGrid1_ItemDataBound">

 

 

<MasterTableView TableLayout="Fixed" DataKeyNames="nusuario" EditMode="InPlace">
<Columns>
<telerik:GridBoundColumn UniqueName="nusuario" DataField="nusuario" HeaderText="Nusuario" ReadOnly="True" />  

 

 

<telerik:GridBoundColumn UniqueName="nombre" DataField="nombre" HeaderText="Nombre" />

 

<telerik:GridDropDownColumn UniqueName="tipo" HeaderText="Tipo" DataField="tipo" ListTextField="tipo" ListValueField="tipo" DataSourceID="SqlDataSource1" DropDownControlType="RadComboBox" />

 

</Columns>

 

</MasterTableView>

 

<ClientSettings>

 

<ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" OnCommand="GridCommand" />

 

</ClientSettings>

 

</telerik:RadGrid 

<br />

 

<asp:Label ID="Label1" runat="server" EnableViewState="false" />

 

<br />

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server" />

 

 

 

Code

 

 

protected void Page_Load(object sender, EventArgs e)

{

 

 

 

 

SqlDataSource1.ConnectionString = Dynamic.Common.

 

DConfig.ConnectionString;

 

 

 SqlDataSource1.SelectCommand =

 

"SELECT * from usuarios order by nusuario";

 

 

/*

if (DConfig.SelCodNac) AddColumn("codnac");

if (DConfig.SelCodArea) AddColumn("codarea");

if (DConfig.SelCodDel) AddColumn("coddel");

if (DConfig.SelCodMonitor) AddColumn("codmonitor");

*/

 

//Update

 

string sql = string.Empty;

 

foreach (GridColumn column in RadGrid1.MasterTableView.Columns)

{

 

 

if (sql != string.Empty) sql += ",";

sql += column.UniqueName +

 

"=@" + column.UniqueName;

 

 

SqlDataSource1.UpdateParameters.Add(column.UniqueName,

 

string.Empty);

 

 

}

SqlDataSource1.UpdateCommand =

 

"UPDATE usuarios SET " +sql +" WHERE nusuario=@nusuario";

 

 

}

 

 

 

 

protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)

{

 

 

if (e.Exception != null){

e.KeepInEditMode =

 

true;

 

 

e.ExceptionHandled =

 

true;

 

 

 

SetMessage(Server.HtmlEncode(

 

"Error al actualizar: " + e.Exception.Message).Replace("'", "&#39;").Replace("\r\n", "<br />"));  

 

 

}

 

 

 

else{

 

GridDataItem dataItem = (GridDataItem)e.Item;

SetMessage(

 

" Nusuario " + dataItem.GetDataKeyValue("nusuario") + " updated");

 

 

}

}

 

 

 

private void DisplayMessage(string text)

{

Label1.Text =

 

string.Format("<span>{0}</span>", text);

 

 

}

 

 

 

private void SetMessage(string message)

{

gridMessage = message;

}

 

 

 

 

protected void RadGrid1_DataBound(object sender, EventArgs e)

 

{

 

 

 

if (!string.IsNullOrEmpty(gridMessage)) DisplayMessage(gridMessage);

 

}

 

 

 

protected void AddColumn(string campo)

 

{

 

 

 

//GridBoundColumn

 

 

 

 

GridDropDownColumn boundColumn = new GridDropDownColumn();

 

boundColumn.UniqueName = campo;

boundColumn.HeaderText = campo.Substring(0, 1).ToUpper() + campo.Substring(1);

boundColumn.DataField = campo;

boundColumn.ListTextField=campo;

boundColumn.ListValueField=campo;

boundColumn.DataSourceID =

 

 

"SqlDataSource1";

 

RadGrid1.MasterTableView.Columns.Add(boundColumn);

 

}

 

 

 

 

 

 

 

protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)

 

{

 

 

 

if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)

 

{

 

 

 

/*

 

GridEditFormItem editform = (GridEditFormItem)e.Item;

DropDownList ddl = (DropDownList)editform.FindControl("ddl");

ddl.Items.Add("foo");

ddl.Items.Add("bar");

*/

 

 

}

}

Daniel
Telerik team
 answered on 21 Feb 2011
3 answers
223 views
Hello,

I am trying to use an Item Template with the Rad Grid but when the control is databound I just get a message saying 'No records to display'.  Here is my code:

ASPX:
<telerik:RadGrid ID="EcsSupplierAgreementsGrid" runat="server" AutoGenerateColumns="false"
               OnNeedDataSource="EcsSupplierAgreementsGrid_NeedDataSource"
               GridLines="None">
               <MasterTableView Width="100%">
                   <ItemTemplate>
                       <%# Eval("SupplierCode")%>
                   </ItemTemplate>
               </MasterTableView>
           </telerik:RadGrid>

ASPX.CS:
protected void EcsSupplierAgreementsGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
  EcsSupplierAgreementsGrid.DataSource = _agreement.SupplierAgreements;
}

The datasource is an IList<T>.  When I debug the line above I can see that the collection has 2 records in it.

Please can you tell me what I am doing wrong.

Thanks
Princy
Top achievements
Rank 2
 answered on 21 Feb 2011
3 answers
104 views
Hi ,

I want to use TreeList on a page. I have some questions about the TreeList control.
1. I want to add a filter for the treelist,just like the filter for RadGrid. How to achieve that?
2. I put a TemplateColumn in the treelist, and I want to display a hyper link in for a column, as 
<telerik:radtreelist id="EntityGrid" runat="server" autogeneratecolumns="false" datakeynames="RecordID"
                parentdatakeynames="ParentID">
            <Columns>
                <telerik:TreeListTemplateColumn UniqueName="ImageHLColHeader" HeaderText="">
                <ItemTemplate>
                    <asp:HyperLink ID="imageHLCol" runat="server" NavigateUrl=<%# Eval("NavURL") %> ImageUrl=<%# Eval("NavImageURL") %> ></asp:HyperLink>
                </ItemTemplate>
                <HeaderStyle Width="35px" />
                </telerik:TreeListTemplateColumn>
            </Columns>
            </telerik:radtreelist>

But the column could not be displayed. It always show empty column in the UI. No  hyperlink is shown up. Seems like the hyperlink is ignored. I even try:
 <ItemTemplate>
                    <%# Eval("RecordID") %>
                </ItemTemplate>

But still could not see anything shown up in the UI. What's wrong?

3. I changed the itemTemplate as
<asp:HyperLink ID="imageHLCol" runat="server"></asp:HyperLink>
and I want to set the navigateURL and ImageURL when the event ItemDataBound is triggered. But I could not find the hyperLink control in that event.
TryCast(e.Item, TreeListDataItem)("ImageHLColHeader").FindControl("imageHLCol") always return nothing. What's wrong? 
Need urgent help. Thank you very very very much.
zxp
Top achievements
Rank 1
 answered on 21 Feb 2011
1 answer
120 views
Hi team,
hyperlink inside gridRow gets active even if gridRow.Enabled=false
Is there any setting for deactivate hyperlink in radgrid.
Princy
Top achievements
Rank 2
 answered on 21 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?