Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
129 views
Hi, everybody!
I have a problem. I want get value column header when I selected row.
<script type="text/javascript">
    var maNV = null;
    var tenDVI = null;
    function rowSelected(sender, args) {        
        var MasterTableView = sender.get_masterTableView();
        var row = MasterTableView.get_selectedItems()[0];          
        maNV = MasterTableView.getCellByColumnUniqueName(row, "MA_DV");            
        tenDVI = MasterTableView.getCellByColumnUniqueName(row, "TEN_DV");            
        var strMA_CTO = maNV.innerHTML; 
        var strTen_DVi = tenDVI.innerHTML;
         
        Service_Test.Web_SELECT_MADVIQLY(strMA_CTO,strTen_DVi);           
         <%Session["CHILD_MADVIQLY"] = "OK";%>
    }
}
 
<div>
<telerik:RadGrid ID="rgdBieu5" runat="server" GridLines="None" AutoGenerateColumns="False"
                    ShowFooter="true" AllowMultiRowSelection="True" OnItemCommand="rgdBieu5_ItemCommand">
                     
                    <MasterTableView ClientDataKeyNames="MA_DV" EnableNoRecordsTemplate="true">
                     <NoRecordsTemplate>
                                Không có dữ liệu
                    </NoRecordsTemplate>
                        <Columns>
                            <telerik:GridBoundColumn HeaderText="Mã đơn vị" DataField="MA_DV" UniqueName="MA_DV" FooterText="Tổng"
                                HeaderStyle-Width="10%">
                                <HeaderStyle Width="10%" HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center"/>
                                <FooterStyle HorizontalAlign="Center" Font-Bold="true"/>
                            </telerik:GridBoundColumn>
                             <telerik:GridBoundColumn HeaderText="Tên đơn vị" DataField="TEN_DV" UniqueName="TEN_DV"
                                HeaderStyle-Width="20%">
                                <HeaderStyle Width="20%" HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left" />
                               
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="3 pha Ä‘iện tá»­" DataField="KH_3PD" UniqueName="KH_3PD"
                                DataFormatString="{0:### ### ### ### ### ##0}" Aggregate="Sum" HeaderStyle-Width="10%">
                                <HeaderStyle Width="10%" HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Right"/>
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowColumnsReorder="false" ReorderColumnsOnClient="true" EnableRowHoverStyle="true"
                        EnablePostBackOnRowClick="false">
                        <Selecting AllowRowSelect="true" />                       
                        <Scrolling AllowScroll="false" UseStaticHeaders="true" />
                        <ClientEvents OnRowSelected="rowSelected"/>
                    </ClientSettings>
                </telerik:RadGrid>
</div>

Have you any ideas? Thank you very much!
Princy
Top achievements
Rank 2
 answered on 21 Mar 2013
1 answer
91 views
The object structure I'm trying to bind to TreeList has nested Lists as properties, but no ID fields. Can I bind to the TreeList control in such a way that its structure matches the structure of my object without the need for setting the key properties?
Radoslav
Telerik team
 answered on 21 Mar 2013
3 answers
197 views
Folks, Using RadControls for ASP.NET AJAX Q1 2013 with VS 2010. I would like to conditionally hide certain filter items based on user rights. Example I have a session variable i.e. Session["UserRights"].

If Session["UserRights"] == "Supervisor" then show all available filter items in a GridDateTimeColumn, if not then available filter items in that column will be No Filter & Equal To.

Attached is my screen shot. Any help will be appreciated.

Thanks

gc_0620
Marin
Telerik team
 answered on 21 Mar 2013
1 answer
265 views

Hi, When i tried to bound a datatable, I am getting index out of bound error:

 Dim table As New DataTable()
            table.Columns.Add("CallID", GetType(Integer))
            table.Rows.Add(12345)
            table.Rows.Add(67890)
           dgCallSearch.DataSource =table
           bgCallSearch.databind()



<Telerik:RadGrid ID="dgCallSearch" runat="server" CssClass="DataGridTable" AutoGenerateColumns="false" Visible="true" OnNeedDataSource="dgCallSearch_NeedDataSource1">
<ItemStyle CssClass="DataGridItem"></ItemStyle>
<AlternatingItemStyle CssClass="DataGridItem"></AlternatingItemStyle>
<HeaderStyle CssClass="DataGridHeader"></HeaderStyle>
                                        <MasterTableView>
<Columns>
                                                <Telerik:GridBoundColumn DataField="CallID" HeaderText="ID">

                                                </Telerik:GridBoundColumn>
                                            </Columns>
</MasterTableView>

</Telerik:RadGrid>


Error Log:
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.ArrayList.get_Item(Int32 index)
   at Telerik.Web.UI.GridColumnCollection.System.Web.UI.IStateManager.SaveViewState()
   at Telerik.Web.UI.GridTableView.GetStructureState()
   at Telerik.Web.UI.RadGrid.SaveTableViewStructure(ArrayList stateList, GridTableView tableView)
   at Telerik.Web.UI.RadGrid.SaveViewState()
   at System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode)
   at System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode)
   at System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode)
   at System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode)
   at System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode)
   at System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode)
   at System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode)
   at System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode)
   at System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode)
   at System.Web.UI.Page.SaveAllState()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at PSCU.CUScripter.Web.UI.BasePage.ProcessRequest(HttpContext context) in c:\Projects\CUScripter 3.0\v3.2.0\CUScripter.Common\Web\BasePage.cs:line 343
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Marin Bratanov
Telerik team
 answered on 21 Mar 2013
2 answers
118 views
Hi,

We have ASP.NET application that has master page that contains content page with master/detail grids. Master grid can be 1 while detail grids can be more. Detail grids are placed in separate rad tabs. In every grid we have context menu where from we start exporting grid data to Excel.

The handler for exporting is placed to master page.

The question is how can we get the reference of right grid in master page handler? For example, we have 1 master grid and 2 detail grids in 2 rad tabs below. We can click context menu option in first detail grid, but how do we know it's first detail grid?


Thank you in advance,

Goran
Goran
Top achievements
Rank 1
 answered on 21 Mar 2013
3 answers
179 views
I have a RadGrid that's using a RadImageColumn to display an image based on the value of a field in the data source, which is working perfectly fine.

However, when my datasource is bound to a collection of an interface type, I'm getting the error "Object does not match target type".

My classes are structures as follows:

interface I
{
    string ImageURL
}
class A : I
{
    string ImageUrl { get { ... } }
}
class B : I
{
    string ImageURL { get { ... } }
}

I'm binding to a datasource that is a collection of items of type I.  What appears to be happening is that when my datasource only contains records of either type A or only records of type B, the grid binds succesfully.  The problem seems to occur when I try to bind to a datasource that contains both types, and only occurs the first time it tries to bind to the second type.  Presumably this might also cause problems with abstract classes, or other derived properties.
Mathew
Top achievements
Rank 1
 answered on 21 Mar 2013
1 answer
78 views
Hi all,
 I have created a webusercontrol using rad combobox.It is working fine when I am using it in the same project. Once I have converted it into a custom control and used its dll in another project ,I can't access its items. If I use asp combobox, it is working fine in all scenario. Please provide me a solution to solve this issue.

Thank you
Abhilash
Abhilash
Top achievements
Rank 1
 answered on 21 Mar 2013
1 answer
112 views
In normal ASP textbox width in percentage from css is working and also we can only an input is rendering. But when we use Telerik Custom control we can see a span is renderin first then inside that span textbox is rendering. So that this span automatically setting 160px width so if we put width:50% the text box will take 50% of this Span ie 80px.

But in other case it will calculate the td width and set the 50% of that td width.
Galin
Telerik team
 answered on 21 Mar 2013
1 answer
186 views
I am using a RadComboBox for item selection on a page in my web application.  The box is loaded with possible selections based on the currently logged in user.  I was running into an issue where no matter what item I select in the RadComboBox, the SelectedValue is always -1 and the SelectedIndex is always 0 no matter which item I select, while the Text property is accurate.  I searched many posts and saw possibilities surrounding page postback but I am checking for a Not Postback before loading the box.  My RadComboBox is on the page as follows:

<telerik:RadComboBox ID="rcbRetailProducer" runat="server" Width="224px"
     EnableLoadOnDemand="false" HighlightTemplatedItems="true"
     MarkFirstMatch="true" ForeColor="black" BackColor="white" AllowCustomText="false"
     DropDownWidth="350px">
</telerik:RadComboBox>

In the Code behind in the PageLoad event I have"

If Not Page.IsPostBack Then
     .....
     PopulateFormFields()
     .....
End If

And within the PopulateFormFields code block I have:
       
Dim retailDS As New DataSet
MyBase.ErrHdlr(DBLists.GetRetailProducersDDL(retailDS))
Me.rcbRetailProducer.DataSource = retailDS.Tables(0)
Me.rcbRetailProducer.DataTextField = "Name"
Me.rcbRetailProducer.DataValueField = "Value"
Me.rcbRetailProducer.DataBind()
Me.rcbRetailProducer.Items.Insert(0, New RadComboBoxItem(" ", "-1"))

The RadComboBox gets filled with all possibilities, but no matter what I select when I place a break in my code and check the SelectedValue and SelectedIndex properties, SelectedValue is -1 and SelectedIndex is 0

There are a small handful of users in the system that have large amounts of data that can be loaded into this box, to the tune of around 2,000 - 2,500 records.  Aside from these very few users, the rest of the user base has maybe a few hundred.  I modified the procedure that loads the retailDS dataset shown above to return only 10 records, and when I did that everything works fine!! So, can the radcombobox not handle large lists?  If not, what is the max?  Right now if this RadComboBox returns 2500 records then SelectedValue and SelectedIndex never hold the proper value....but they work fine with the exact same code if I limit the dataset to less records.
Nencho
Telerik team
 answered on 21 Mar 2013
7 answers
368 views
I am including an expand/collapse all button in the header of my first PanelBar Item. How do I add back the default arrow button that shows up on the right for the default headers?

Thanks,
Dan
Kate
Telerik team
 answered on 21 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?