Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
385 views
Hi All,

I have button inside the rad grid control. I want to fetch the particular grid row data (ex. hidden field value) on button click. For this I wrote code like this...

    protected void btnOne_OnClick(object sender, EventArgs e)
    {
        Button btn = (Button)sender;
        GridDataItem item = (GridDataItem)btn.NamingContainer;    
        HiddenField hdn = (HiddenField)item.FindControl("hdnOne");
    }

It is working, but some time it shows the value is repeating (i.e. showing some other value for hidden field). Is there any other way, to do this..
Thanks in advance.
Akki
Jayesh Goyani
Top achievements
Rank 2
 answered on 01 Mar 2012
3 answers
91 views
Hi,

I'm trying to use the RadTreeView with fixed width and with overflow: auto. In IE9 after the horizontal scrollbar has appeared if you hover with mouse over any node the TreeView enlarges (mean it's higher). This happend every time, so the TreeView is higher and higher. Here is a sample code:

aspx:
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="rsmMain" runat="server" EnablePageMethods="true" EnableScriptGlobalization="true" EnablePartialRendering="true"/>
    <telerik:RadTreeView ID="rtvTree" runat="server" style="width: 150px; overflow: auto; border: 1px solid black;" />
    </form>
</body>
</html>

code behind:
protected void Page_Load(object sender, EventArgs e) {
      rtvTree.Nodes.AddRange(new List<RadTreeNode>() { new RadTreeNode("test Node 01", "1"), new RadTreeNode("test Node 02", "2") });
      rtvTree.Nodes[0].Nodes.AddRange(new List<RadTreeNode>() { new RadTreeNode("test Node 01 - 01", "3"), new RadTreeNode("test Node 01 - 02", "4") });
      rtvTree.Nodes[0].Nodes[0].Nodes.AddRange(new List<RadTreeNode>() { new RadTreeNode("test Node 01 - 01 - 01", "5"), new RadTreeNode("test Node 01 - 01 - 02", "6") });
    }

If you'll expand all nodes, horizontal scroll bar will appear.
Please let me know whether I miss something important or whether is there some work-around.

Thanks,

Petr Kotal.
Ivan Zhekov
Telerik team
 answered on 01 Mar 2012
7 answers
171 views
Hello,

The following are the div IDs which we bind in the editor control. But these div ids are removed when i click in the indent command.

<div id="VTL"></div>
<div id="D7"></div>
<div id="Med"></div>
<div id="Dia"></div>
<div id="Ord"></div>
<div id="Imm"></div>
<div id="D142"></div>

If DIV ID has data then DIV ID is not removed when click in the indent.

The following is the example of DIV ID has data:
<div id="All"><span style="color: #000000;"><span style="font-size: 11pt; font-weight: bold; font-family: tahoma; color: #000000;">Allergies</span><br />
<span style="font-size: 11pt; font-weight: bold; font-family: tahoma; color: #000000;">Drug Allergies:</span> <span style="font-size: 11pt; font-family: tahoma; color: #000000;">5-hydroxytryptophan (Generic: 5-hydroxytryptophan), Onset Date: 03/03/2011, Reaction: high, Intolerable.</span></span></div>

And I also used these code but no solution:

 <script type="text/javascript">
        function OnClientCommandExecuted(editor, args) {
            var commandName = args.get_commandName();
            var editorParentSelection = editor.getSelection().getParentElement();

            switch (commandName) {

                case "Indent":
                    var selectedElement = editor.getSelectedElement();

                    while (!Telerik.Web.UI.Editor.Utils.isEditorContentArea(selectedElement) && !(selectedElement.tagName.toLowerCase() == "blockquote")) {
                        selectedElement = selectedElement.parentNode;
                    }

                    var tempDiv = editor.get_document().createElement("div");
                    tempDiv.style.cssText = "margin-left:30px";
                    tempDiv.innerHTML = selectedElement.innerHTML;

                    selectedElement.parentNode.replaceChild(tempDiv, selectedElement);

                    break;

                case "Outdent":
                    editorParentSelection.outerHTML;
                    break;

                default:
                    break;
            }

        }
 
    </script>
<telerik:RadEditor ID="RadEditor1" runat="server" OnClientCommandExecuted="OnClientCommandExecuted">
    <Content>test</Content>
</telerik:RadEditor>


These is the major problem.

Please help me as soon as possible.
Thanks
Best Regards
Jiten Mutum



Rumen
Telerik team
 answered on 01 Mar 2012
3 answers
123 views
I'm creating a treeview via a database. Currently, only the root node is displayed when the page loads. Is there an equivilent to the Microsoft Treeview ExpandDepth so that I can display the first level underneath the root as well?

I tried expanding root node in the code behind without success. Here is my code:

<telerik:RadTreeView ID="RadTreeView1" runat="server" DataSourceID="DataMart" DataFieldID="cellkey" 
    DataFieldParentID="cellparent" DataTextField="celldescriptor"   
    LoadingStatusPosition="BeforeNodeText" SingleExpandPath="True">  
    <CollapseAnimation Duration="100" Type="None" /> 
    <ExpandAnimation Duration="100" Type="None" />      
</telerik:RadTreeView> 
<asp:SqlDataSource ID="DataMart" runat="server" ConnectionString="<%$ ConnectionStrings:DataMart %>" 
    SelectCommand="SST.PR_GET_JUPITER_TREE" SelectCommandType="StoredProcedure">  
    <SelectParameters> 
        <asp:Parameter DefaultValue="2" Name="Starting_Node" Type="Int32" /> 
    </SelectParameters> 
</asp:SqlDataSource> 

Thanks!
Frederik
Top achievements
Rank 1
 answered on 01 Mar 2012
2 answers
42 views
We having an issue with RAD control on machine with WindowsXP using IE8. When css class for table cell in Table Wizard is set, the setting is cleared after switching to another cell and back to the primary one. As I can see online demo version of RAD control does’nt have such issue. Is this a known issue for some older version of this control?
Serhiy
Top achievements
Rank 1
 answered on 01 Mar 2012
3 answers
127 views
I have read some threads about this regarding folder/file authorities but still cannot connect to any DBs.

Environment is..
SQL Express running under Network Service.
I have admin priviledges.
Connection string is "Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Temp\Delete Anytime\ExpressionWebTests\Telerik\Rotator\App_Data\Northwind.mdf";Integrated Security=True;User Instance=True"

I am using 'Windows Authentication' in the 'Log on to the server' dialogue box.
Message I get is...

"Failure to generate a user instance of SQL server due to a failure in starting the process for the user instance....."

Exception Stack
[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5064474
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5078123
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.SqlClient.SqlConnection.Open() +125
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +123
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +319
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1618
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   Telerik.Web.UI.RadListView.PerformSelect() +24
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.RadListView.DataBind() +17
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
   Telerik.Web.UI.RadListView.CreateChildControls() +53
   System.Web.UI.Control.EnsureChildControls() +102
   System.Web.UI.WebControls.CompositeDataBoundControl.get_Controls() +15
   Telerik.Web.UI.RadAjaxControl.PopulatePlainPanels(Control parent, List`1 list, Control root) +68
   Telerik.Web.UI.RadAjaxControl.OnPagePreRender(Object sender, EventArgs e) +1160
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnPreRender(EventArgs e) +8997922
   System.Web.UI.Control.PreRenderRecursiveInternal() +103
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

Kate
Telerik team
 answered on 01 Mar 2012
1 answer
62 views
Hy,

Is it possible to adjust the width of combobox dropdown window dynamically...I want to display only 'Name' in comboBox input field on selecting a value...But i am displaying a table with three columns in itemtemplate,now my comboBox also has the width of table....Is there any possible way?
Thnx in advance
Princy
Top achievements
Rank 2
 answered on 01 Mar 2012
2 answers
261 views
Hello,

I am trying to access a cell value on post back when ever the user will click command button (select) in RadGrid. I have a command button with name select and this is what I am doing in code behind:

    protected void leadsGrid_ItemCommand(object sender, GridCommandEventArgs e)
    {
        GridDataItem myDataItem = (GridDataItem)leadsGrid.SelectedItems[0].DataItem;
        Response.Write(myDataItem["lead_name"].Text);
    }

but whenever I click on select button it gives me

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index


I supposed its occurring because SelectedItems[0] does not have anything but I don't know why it does not have anything as pressing the select command should select the row ?

Please tell me what I am doing wrong ? or a correct way to access cell values of selected row. I am not working on multiple rows so I only want to access cell values of one select row. I have experience with normal ASP.net GridView but I am fairly new with RadGrid so I apologize if this is a basic question.

Thanks.
Tahir Ahmed
Top achievements
Rank 1
 answered on 01 Mar 2012
31 answers
901 views
RadButton icon disappears after mouse over. Very strange behavior.
Just going over with the mouse cursor over the button will cause the icon to disappear.
I attached a before and after screenshots and here is a code snippet:
<telerik:RadButton ID="btnAdvancedLookup" runat="server" Text="Advanced Lookup" 
                     PostBackUrl="~/AdvancedLookup.aspx" AutoPostBack="true" >
                    <Icon PrimaryIconUrl="../Images/Buttons/Search.gif"/>
                    </telerik:RadButton>

Slav
Telerik team
 answered on 01 Mar 2012
2 answers
63 views
After updating to Q1 2012 where ExplorerMode="Thumbnails" by default I have switched back it to  grid view (ExplorerMode="Default"
). So FileExplorer is not recognize files in grid view. All files is shown as folders. See screenshot attached.
KAB
Top achievements
Rank 1
 answered on 01 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Nakul
Top achievements
Rank 3
Iron
Iron
Iron
Rina
Top achievements
Rank 2
Iron
Iron
Mukesh
Top achievements
Rank 2
Iron
Iron
Iron
Ruksana
Top achievements
Rank 2
Iron
Iron
Rakesh
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Nakul
Top achievements
Rank 3
Iron
Iron
Iron
Rina
Top achievements
Rank 2
Iron
Iron
Mukesh
Top achievements
Rank 2
Iron
Iron
Iron
Ruksana
Top achievements
Rank 2
Iron
Iron
Rakesh
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?