Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
107 views
Where do I change the text "No records to display." In The FileExplorer Grid to the Swedish text?
Princy
Top achievements
Rank 2
 answered on 21 Sep 2011
1 answer
87 views
Hello,

Please have a look at the following code:

<telerik:GridTemplateColumn HeaderText="Update" ItemStyle-Width="8%">
    <FilterTemplate>
        <div class="filter-wrapper">
            <div>
                <telerik:RadComboBox runat="server" ID="ddlUpdateFilter" AutoPostBack="true"
                    OnSelectedIndexChanged="ddlUpdateFilter_SelectedIndexChanged" MarkFirstMatch="true"
                    AllowCustomText="true" ShowToggleImage="false" Width="70px">
                </telerik:RadComboBox>
                <img src="../Resources/Common/filter.png" runat="server" id="imgUpdateFilter"
                    alt="filter" />
                <asp:ImageButton runat="server" ID="imgClearUpdateFilter" ImageUrl="~/Resources/Common/clear-filter.gif"
                    CommandName="ClearFilter" />
            </div>
        </div>
    </FilterTemplate>
    <ItemTemplate>
        <asp:CheckBox runat="server" ID="chkEdit" Enabled="false" />
    </ItemTemplate>
</telerik:GridTemplateColumn>

 I have a TemplateColumn in which I'm using FilterTemplate to apply filter on this column. The functionality is working fine in IE but when I open my page on Firefox or Chrome, all the columns having FilterTemplate become so wide that the grid blows off the page to the right. Once I write AllowFiltering="false" for that column, the column width comes back but obviously filtering is gone too.

A quick response in this regard will be highly appreciated.

Thanks.

~Ahmed
Marin
Telerik team
 answered on 21 Sep 2011
1 answer
75 views
Hi there,

I have a Rad Ajax Grid in which I'm dynamically adding pagesize values for the pagesize combobox.
When loading, I'm retrieving a user's preferred page size and applying this to the grid.
When the pagesize is changed I would like to save the new size to a database but I'm having a problem.

At the moment I know the PageSizeChanged event is being fired by showing an alert, but a function I'm calling to write the value back to the database doesn't seem to be called.
If I place an alert before and after my function they both fire.   I know the function works because I'm using it elsewhere on the page (i.e. if there's not value set, I write a default etc).

Can anyone offer any suggestions as to why this is causing a problem?

Cheers
Rich
Marin
Telerik team
 answered on 21 Sep 2011
3 answers
122 views
Hi,

I'm having problems exporting from a filtered gridcontrol. Whenever I apply a filter, it is applied perfectly on the webinterface, but exporting to .pdf format seems to ignore the filter, resulting in a full list of the datasource in the pdf file.

I've spent half a day reading through your forums, and tried every relevant course, without any luck. I've noticed that most of these, are not using OnNeedDataSource as datasource, could my problem be here?

I would be happy to supply code snippets, but as I have tried at least 10 different things with no success, I don't think my problem lies in the export itself.

I am not doing anything custom with the filtering, but it seems like the MasterTableView has forgotten its filtering, once the pdf event is fired. Should I be doing anything to ensure that the filter persists?

Any and all help would be much appreciated - and if you need additional info I'll supply it ASAP :)
Jakob
Top achievements
Rank 1
 answered on 21 Sep 2011
3 answers
105 views
 Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound

e.Item.DataItem("Option").ToString

Option Strict On disallows late binding.
Daniel
Telerik team
 answered on 21 Sep 2011
0 answers
75 views

EditFormSettings inside RadTextBox or radcombobox, Radnumerictextbox,
How to restrict Enter Key are not going to be work


And also how find in javascript also

Thanks,
Moahmed.
mohamed
Top achievements
Rank 1
 asked on 21 Sep 2011
5 answers
131 views
Hello,

In my web application, i using a radlistbox, and I have enabled 'StartsWith' mode to find item.
The entries in the radlistbox are so many, in fact, for some most common letters, I overcome the more than 20 entries that appear in the box.

Problem is that some items are not selected even if the user inputs the correct initials sequence.
For example, suppose the user search "SVIMSVILUPPO" item. Begin to type the S, and get the image 1.

But when the user continues to type the search (... VIM ...), the item is not highlighted, although there is: see picture 2.

And this behaviors is for all entries beginning with 'S' that does not appear in the 'first page of S' (image 1, and therefore BRINIDISI SISR-up).
RadListBox is populating with a query on the db, so it is impossible to know in advance how many and which items it contains.

How can I keep 'StartsWith' mode for all items radlistbox?

Vittorio
Peter Filipov
Telerik team
 answered on 21 Sep 2011
1 answer
70 views
Hello,

 I am having trouble that RadFilter is not detecting the columns correctly. I bind my RadGrid through code in Asp like:

RadGrid1.DataSource = myDataSource;
RadGrid.DataBind();

RadFilter is only binding those columns which are bind through <telerik:GridBoundColumn> and ignoring those who are in <telerik:GridTemplateColumn>. Is this a known issue? as I didn't see any thread talking about this problem. Waiting for help immediately.

Regards,
Wasim.
Iana Tsolova
Telerik team
 answered on 21 Sep 2011
1 answer
267 views

I modified editondblclick sample to use the custom datatable instead of SQL connection.
Everything worked but while save the edited values we are getting "Only items with ISinEditmode set to true can be updated" error.

asp code:
  
  
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridEdit.aspx.cs" Inherits="GridEdit" %>
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
  
<head runat="server">
  
  
  
<title>Untitled Page</title>
  
</head>
  
<body>
  
  
  
<form id="form1" runat="server" method="post">
  
  
  
<div>
  
  
  
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
  
  
  
<!-- content start -->
  
  
  
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
  
  
<script type="text/javascript">
  
  
  
<!--
  
var hasChanges, inputs, dropdowns, editedRow;
  
  
function RowClick(sender, eventArgs)
  
{
  
if(editedRow && hasChanges)
  
{
  
hasChanges = false;
  
if(confirm("Update changes?"))
  
{
  
$find("<%= RadGrid1.ClientID %>").get_masterTableView().
  
$find("<%= RadGrid1.ClientID %>").get_masterTableView().updateItem(editedRow);
  
}
  
}
  
}
  
function RowDblClick(sender, eventArgs)
  
{
  
editedRow = eventArgs.get_itemIndexHierarchical();
  
$find("<%= RadGrid1.ClientID %>").get_masterTableView().editItem(editedRow);
  
}
  
  
function GridCommand(sender, args)
  
{
  
if (args.get_commandName() != "Edit")
  
{
  
editedRow = null;
  
}
  
}
  
function GridCreated(sender, eventArgs)
  
  
var gridElement = sender.get_element();
  
var elementsToUse = [];
  
inputs = gridElement.getElementsByTagName("input");
  
for (var i = 0; i < inputs.length;i++)
  
{
  
var lowerType = inputs[i].type.toLowerCase();
  
if(lowerType == "hidden" || lowerType == "button")
  
{
  
continue;
  
}
  
  
Array.add(elementsToUse, inputs[i]);
  
inputs[i].onchange = TrackChanges;
  
}
  
  
dropdowns = gridElement.getElementsByTagName("select");
  
for (var i = 0; i < dropdowns.length;i++)
  
{
  
dropdowns[i].onchange = TrackChanges;
  
}
  
setTimeout(function(){if(elementsToUse[0])elementsToUse[0].focus();},100);
  
}
  
function TrackChanges(e)
  
{
  
hasChanges = true;
  
}
  
--> 
  
</script>
  
  
  
</telerik:RadCodeBlock>
  
  
  
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
  
  
  
<AjaxSettings>
  
  
  
<telerik:AjaxSetting AjaxControlID="RadGrid1">
  
  
  
<UpdatedControls>
  
  
  
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
  
  
  
<telerik:AjaxUpdatedControl ControlID="Label1" />
  
  
  
</UpdatedControls>
  
  
  
</telerik:AjaxSetting>
  
  
  
</AjaxSettings>
  
  
  
</telerik:RadAjaxManager
  
<telerik:RadGrid ID="RadGrid1" Width="97%" 
  
ShowStatusBar="True" AllowSorting="True" PageSize="7" GridLines="None" AllowPaging="True"
  
  
  
runat="server" AllowAutomaticUpdates="True" OnItemUpdated="RadGrid1_ItemUpdated" AutoGenerateColumns="False" OnDataBound="RadGrid1_DataBound">
  
  
  
<MasterTableView TableLayout="Fixed" DataKeyNames="ProductID" EditMode="InPlace">
  
  
  
<Columns>
  
  
  
<telerik:GridBoundColumn UniqueName="ProductID" DataField="ProductID" HeaderText="ProductID" ReadOnly="True" FilterControlAltText="Filter ProductID column" >
  
  
  
<HeaderStyle Width="10%" />
  
  
  
</telerik:GridBoundColumn>
  
  
  
<telerik:GridBoundColumn UniqueName="ProductName" DataField="ProductName" HeaderText="Product name" ColumnEditorID="GridTextBoxColumnEditor1" FilterControlAltText="Filter ProductName column" >
  
  
  
<HeaderStyle Width="25%" />
  
  
  
</telerik:GridBoundColumn
  
</Columns
  
</MasterTableView>
  
  
  
<ClientSettings>
  
  
  
<ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick"
  
  
  
OnGridCreated="GridCreated" OnCommand="GridCommand" />
  
  
  
</ClientSettings>
  
  
  
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
  
  
  
</HeaderContextMenu>
  
  
  
<FilterMenu EnableImageSprites="False">
  
  
  
</FilterMenu>
  
  
  
</telerik:RadGrid>
  
  
  
<telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="180px" />
  
  
  
<br />
  
  
  
<asp:Label ID="Label1" runat="server" EnableViewState="false" />
  
  
  
<br /> 
  
   
  
</div>
  
  
  
</form>
  
</body>
  
</html>
  
  
  
aspx.cs code:
  
  
protected void Page_Init(object sender, EventArgs e)
  
{
  
LoadData();
  
}
  
   
  
private void LoadData()
  
{
  
DataTable table = new DataTable();
  
table.AcceptChanges();
  
  
DataColumn col1 = new DataColumn("ProductID");
  
DataColumn col2 = new DataColumn("ProductName");
  
col1.DataType = System.Type.GetType("System.String");
  
col2.DataType = System.Type.GetType("System.String");
  
table.Columns.Add(col1);
  
table.Columns.Add(col2);
  
   
  
for (int i = 0; i < 2; i++)
  
{
  
DataRow row = table.NewRow();
  
row[col1] = i;
  
row[col2] = "111";
  
table.Rows.Add(row);
  
}
  
  
RadGrid1.DataSource = table;
  
RadGrid1.Rebind(); 
  
}
  
protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
  
{
  
if (e.Exception != null)
  
{
  
e.KeepInEditMode = true;
  
e.ExceptionHandled = true;
  
SetMessage(Server.HtmlEncode("Unable to update Products. Reason: " + e.Exception.Message).Replace("'", "'").Replace("\r\n", "<br />"));
  
}
  
else
  
  
  
{
  
GridDataItem dataItem = (GridDataItem)e.Item;
  
SetMessage(" ProductID " + dataItem.GetDataKeyValue("ProductID") + " updated");
  
}
  
DisplayMessage(gridMessage);
  
}
  
private void DisplayMessage(string text)
  
{
  
Label1.Text = string.Format("<span>{0}</span>", text);
  
}
  
private void SetMessage(string message)
  
{
  
gridMessage = gridMessage + " " + message;
  
}
  
private string gridMessage = "Start ";
  
protected void RadGrid1_DataBound(object sender, EventArgs e)
  
{
  
if (!string.IsNullOrEmpty(gridMessage))
  
{
  
DisplayMessage(gridMessage);
  
}
  
}
Mira
Telerik team
 answered on 21 Sep 2011
1 answer
225 views

Hi, friends i am new to Telerik...Need Help..

I am using  Below code to populate data into radgrid...

can i use rad filter without datasource id to filter grid..and  i want the  columns of  sql query into rad filter through datset ds Only .Any code..?.

protected void Page_Load(object sender, EventArgs e)
   {
 
       SqlConnection con = new SqlConnection(conStr);
       con.Open();
       SqlDataAdapter da = new SqlDataAdapter("SELECT NAME,STATUS_ID,DATE, FROM TBL_TABLE", con);
 
       DataSet ds = new DataSet();
       da.Fill(ds);
       RadGrid1.DataSource = ds;
 
       RadGrid1.DataBind();
       con.Close();
 
   }
 
Shinu
Top achievements
Rank 2
 answered on 21 Sep 2011
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?