Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
157 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
97 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
157 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
87 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
311 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
254 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
1 answer
93 views
How do I change the text color for the file explorer grid and tree, when I use the Black skin
Now it is light gray, I want it black. I have set the background for the grid and tree to white ....
Even how I change the selected and mouseover
Princy
Top achievements
Rank 2
 answered on 21 Sep 2011
1 answer
327 views
Hi,

is there a way to use MaskedTextBox control with Mask property defined using standard regular expression syntax? The custom syntax does not cover all scenarios.

Thanks,
Alexander
Shinu
Top achievements
Rank 2
 answered on 21 Sep 2011
2 answers
172 views
I'm attempting to customize the insertimage.ascx to allow for a custom image dialog to populate the image source.  I reviewed the customization of the linkmanager.ascx and have tried the below code, but I keep getting a javascript error stating that the Telerik.Web.UI.Dialogs is undefined.  I've obviously forgotten something or misunderstood how to access our own image selector.  I've got to use custom dialogs for flash, images and slideshows.  I've got our document dialog working fine with teh LinkManager, but am stuck here.  Any assistance would be great.

<script type="text/javascript">
    function showCustomDialog() {
        debugger;
        var argument = {};
 
        var callbackFunction = function (sender, args) {
            var oTextBox = $get("ImageSrc");
            oTextBox.value = args;
        }
        var dialogOpener = Telerik.Web.UI.Dialogs.CommonDialogScript.get_windowReference().get_dialogOpener();
        dialogOpener.openUrl("/custom_editors/Images.aspx", argument, 900, 650, callbackFunction, null, "image manager", true, 36, false, true);
    }
</script>

<div id="InsertImage" class="reInsertImageWrapper" style="display: none;">
    <table cellspacing="0" cellpadding="0" border="0" class="reControlsLayout">
        <tr>
            <td style="vertical-align: top;">
                <label class="reDialogLabelLight" for="ImageSrc">
                    <span>[imagesrc]</span>
                </label>
            </td>
            <td class="reControlCellLight">
                <table border="0" cellpadding="" cellspacing="0">
                    <tr>
                        <td>
                            <input type="text" id="ImageSrc" class="rfdIgnore" />
                        </td>
                        <td style="padding-left: 4px;">
                            <input id="Button1" type="image" value="Browse" onClick="showCustomDialog();return false;" src="/images/icons/image_add.png" class="imgButton"/>
                            <tools:StandardButton runat="server" ToolName="ImageManager" id="ImageManagerCaller" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <label class="reDialogLabelLight" for="ImageAlt">
                    <span>[imagealttext]</span>
                </label>
            </td>
            <td class="reControlCellLight">
                <input type="text" id="ImageAlt" class="rfdIgnore" />
            </td>
        </tr>
        <tr>
            <td colspan="2" class="reImgPropertyControlCell">
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <label class="reDialogLabelLight" for="ImageWidth">
                                <span>[width]</span>
                            </label>
                        </td>
                        <td>
                            <input type="text" id="ImageWidth" class="rfdIgnore" />  px
                        </td>
                        <td>
                            <label class="reDialogLabelLight" for="ImageHeight">
                                <span>[height]</span>
                            </label>
                        </td>
                        <td>
                            <input type="text" id="ImageHeight" class="rfdIgnore" />  px
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <table border="0" cellpadding="0" cellspacing="0" class="reConfirmCancelButtonsTblLight">
                    <tr>
                        <td align="right">
                            <button type="button" id="iplInsertBtn">
                                [ok]
                            </button>
                        </td>
                        <td>
                            <button type="button" id="iplCancelBtn">
                                [cancel]
                            </button>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>

Rumen
Telerik team
 answered on 21 Sep 2011
1 answer
293 views
I have an aspx page that has a RadGrids. I want to perform different operation in clicking and double-clicking the row. I have two client-side events for OnRowClick and OnRowDblClick. But RowClick is always called even I have double-clicking the row. How to make

OnRowDblClick together with OnRowClick ?


 Here are my codes:

 

 

function OnRowClick(sender, eventArgs) {

 

    alert(

 

"Row-Clicking")

 

}

 

 

function RowDoubleClick(sender, eventArgs) {

 

    alert(

 

"Double-clicking")

 

 }

<

 

 

telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowSorting="false"

 

 

 

AllowMultiRowSelection="False" AllowPaging="True" GridLines="Both" ShowGroupPanel="false"

 

 

 

OnItemCommand="RadGrid_ItemCommand" OnNeedDataSource="RadGrid_NeedDataSource"

 

 

 

OnItemDataBound="OnGridItemDataBound">

 

 

 

<PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle>

 

 

 

<MasterTableView DataKeyNames="MeterStationNumber" AllowMultiColumnSorting="False">
----

 

 

 

</MasterTableView>

 

<

 

 

ClientSettings AllowDragToGroup="false" EnableRowHoverStyle="true" >

 

 

 

<ClientEvents OnRowDblClick="RowDoubleClick" OnRowClick="OnRowClick"/>

 

 

 

</ClientSettings>

 

Princy
Top achievements
Rank 2
 answered on 21 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?