Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
84 views
how could i generate radcombobox object in asp.net vs 2010

Advanced Thanks
Tamim
Tamim
Top achievements
Rank 1
 asked on 06 Jun 2012
1 answer
269 views
I'm using ASP.NET AJAX Q1 2012 SP1.  I have a RadGrid with a GridDropDownColumn.  The RadGrid is populated on server side from the RadGrid's NeedDataSource event.  Everything is working except the expected DataField value is blank when the grid is in a non edit mode.  To test I even added a GridBoundColumn with the same DataField name to show that it does have a value.

<telerik:RadGrid ID="rgDepartment" runat="server" Skin="Office2007"
    AutoGenerateColumns="False" AutoGenerateDeleteColumn="True" CellSpacing="0"
    GridLines="None" AllowMultiRowEdit="true">
    <MasterTableView DataKeyNames="OrgDepartmentId" AutoGenerateColumns="false" EditMode="InPlace"
        CommandItemDisplay="Top">
        <Columns>
            <telerik:GridBoundColumn DataField="Name"
                HeaderText="Dept"
                UniqueName="Name">
            </telerik:GridBoundColumn>
            <telerik:GridDropDownColumn ListTextField="Name" ListValueField="DepartmentId" DataField="Name"
                HeaderText="Department" DropDownControlType="DropDownList"
                UniqueName="OrgDept">
            </telerik:GridDropDownColumn>
            <telerik:GridBoundColumn DataField="DepartmentId"
                HeaderText="Speech Rec Object Id"
                MaxLength="255" UniqueName="DepartmentId">
            </telerik:GridBoundColumn>
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Server side programming.
Protected Sub rgDepartment_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles rgDepartment.ItemDataBound
    If (TypeOf e.Item Is GridEditableItem AndAlso CType(e.Item, GridEditableItem).IsInEditMode) Then
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        ' Hides the Update button for each edit form
        editedItem("EditCommandColumn").Controls(0).Visible = False
        ' Apply the text box style
        CType(editedItem("DepartmentId").Controls(0), TextBox).CssClass = "TextBoxStyle"
        ' Populate drop down
        Dim editMan As GridEditManager = editedItem.EditManager
        Dim editor As GridDropDownColumnEditor = CType(editMan.GetColumnEditor("OrgDept"), GridDropDownColumnEditor)
        editor.DataSource = GetOrganizationDepartmentData()
        editor.DataBind()
        If e.Item.OwnerTableView.IsItemInserted = False AndAlso e.Item.DataItem("OrgDepartmentId") IsNot Nothing AndAlso e.Item.DataItem("OrgDepartmentId") > 0 Then
            editor.SelectedValue = e.Item.DataItem("OrgDepartmentId").ToString()
        End If
    End If
End Sub
 
Protected Sub rgDepartment_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgDepartment.NeedDataSource
    rgDepartment.DataSource = GetDeptData() ' Get Dataset
End Sub


Here is a screenshot of the web page.
ScreenShot

The only way I can think of getting this to work is to set the cells text to the data value within the ItemDataBound event.  Something like this.
If (TypeOf e.Item Is GridDataItem AndAlso e.Item.IsInEditMode = False) Then
    Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
    dataItem("OrgDept").Text = e.Item.DataItem("Name")
End If

Is this a known bug or am I doing something wrong?

Thanks,

Warren
Shinu
Top achievements
Rank 2
 answered on 06 Jun 2012
1 answer
123 views
Hi Team,

I have a RadGrid with the NestedView Template. So on Expansion of Row in a Grid, We wll have TabStrip control with 5 tabs,
Now i need to iterate the Rows in the Grid and find which row is expanded and what tab is selected at client side.
Currently i am able to find which row is expanded , but when i try to get  NestedViews length it is returing as 0 . Could you please help to get the NestedView items at client side.

if (rows[i].get_nestedViews().length > 0)

 {

 var nestedView = rows[i].get_nestedViews()[0];

 for (var i = 0; i < nestedView.get_dataItems().length; i++) {

 var tabstrip = nestedView.get_dataItems()[i];

 alert(tabstrip.SelectedIndex.toString());

 }

 alert(nestedView.get_name());

 }

Sreeram
Top achievements
Rank 1
 answered on 06 Jun 2012
1 answer
88 views
Hello,

I am having multiple grids and I am using Item Created event for all the grids.

My Scenario is, I want to make some columns visible/Invisible on creating Grid.

How can I handle multiple grid columns in ItemCreated EventHandler.

TIA
Shinu
Top achievements
Rank 2
 answered on 06 Jun 2012
3 answers
169 views
Hello
I Use GridButton Column For Delete An Row.I Want Show Row Info(For Example ProductID)  In PopUp With Rad Window And Then Perform Delete Command.
And My Source Is:
<telerik:RadWindowManager ID="RadWindowManager" runat="server"
        Animation="Slide" Skin="Vista"
    VisibleStatusbar="false" ShowContentDuringLoad="false" ReloadOnShow="true"
        Title="Confirm" />
     
        <telerik:RadGrid ID="RadGrid1" runat="server"
        DataSourceID="SqlDataSource1" GridLines="Vertical" Skin="Sunset" Width="99%"
            AutoGenerateColumns="False" AllowFilteringByColumn="True"
            oneditcommand="RadGrid1_EditCommand"
            onupdatecommand="RadGrid1_UpdateCommand"
            ondeletecommand="RadGrid1_DeleteCommand"
            oninsertcommand="RadGrid1_InsertCommand"
            onneeddatasource="RadGrid1_NeedDataSource" AllowSorting="True"
            AllowPaging="True" onitemcreated="RadGrid1_ItemCreated"
            onprerender="RadGrid1_PreRender" onitemcommand="RadGrid1_ItemCommand"
            Font-Names="Rod" Font-Overline="False" onitemdatabound="RadGrid1_ItemDataBound">
            <GroupingSettings CaseSensitive="false"  />
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
        <MasterTableView DataKeyNames="ProductID"
                        DataSourceID="SqlDataSource1" CommandItemDisplay="Top"   Font-Names="Tahoma"
                PageSize="20">
        <RowIndicatorColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
 
        <ExpandCollapseColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
            <Columns>
            <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="شماره سطر">
                        <ItemTemplate>
                            <asp:Label ID="numberLabel" runat="server" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
               <telerik:GridBoundColumn DataField="ProductID" HeaderText="سریال محصول"
            ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MaxUse" DataType="System.Byte"
            HeaderText="حداکثر استفاده" SortExpression="MaxUse" UniqueName="MaxUse">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Used" DataType="System.Byte"
            HeaderText="تعداد استفاده" SortExpression="Used" UniqueName="Used">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn Visible="false" DataField="Status" DataType="System.Byte"
            HeaderText="وضعیت" SortExpression="Status" UniqueName="Status">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Description" DataType="System.Byte"
            HeaderText="توضیحات" SortExpression="Description" UniqueName="Description">
        </telerik:GridBoundColumn>
         <telerik:GridBoundColumn DataField="LastEditDate" DataType="System.Byte"
            HeaderText="آخرین ویرایش" SortExpression="LastEditDate" UniqueName="LastEditDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastEditor" DataType="System.Byte"
            HeaderText="آخرین ویرایشگر" SortExpression="LastEditor" UniqueName="LastEditor">
        </telerik:GridBoundColumn>
        <telerik:GridButtonColumn HeaderText="حذف محصول" ConfirmText="محصول مورد نظر حذف گردد؟"
                    ImageUrl="~/images/delete.png" ButtonType="ImageButton" ItemStyle-Width="30px"
                    CommandName="Delete" UniqueName="DeleteColumn" ConfirmDialogType="RadWindow"
                    ConfirmTitle="تایید حذف محصول" ItemStyle-BorderStyle="None">
                    <ItemStyle BorderStyle="None" Width="30px"></ItemStyle>
                    </telerik:GridButtonColumn>
        <telerik:GridButtonColumn HeaderText="ویرایش محصول"
                    ImageUrl="~/images/Edit.png" ButtonType="ImageButton" ItemStyle-Width="30px"
                    CommandName="Edit" UniqueName="EditColumn"
                    ItemStyle-BorderStyle="None">
                    <ItemStyle BorderStyle="None" Width="30px"></ItemStyle>
                    </telerik:GridButtonColumn>
            </Columns>
 
My DeleteColumn Is "DeleteColumn".Any One Can Help Me To Show Row Info  (ProductID) In Delete PopUp Confirmation?
Thanks
PINCO
Top achievements
Rank 1
 answered on 06 Jun 2012
1 answer
196 views
I have a rad combobox in a user control that is rendered inside the content template of a RadWindow....

<telerik:RadWindow ID="popupWindow" VisibleOnPageLoad="false" runat="server">
    <ContentTemplate>
        <!-- Add Any UserControls For Server Side Show/Hide here. -->
        <uc:CaseFlags runat="server" ID="ucCaseFlags" Visible="false" />
    </ContentTemplate>
</telerik:RadWindow>

Initially, when i click in the area for the rad combobox the drop down appeared behind the radwindow, so i added a high value ZIndex value, and now it appears in the correct location.

<div>
    <telerik:RadComboBox ID="comboFlags" runat="server" Height="140px" Width="200px" ZIndex="10000">
    </telerik:RadComboBox>      
 
</div>


However, if you open the drop down, then move the rad window the drop down part of the rad combobox doesnt remain inside the rad window ...

You can see an example of the result in the attached screen capture.



Is there a fix/work around to fix this problem....
Princy
Top achievements
Rank 2
 answered on 06 Jun 2012
1 answer
158 views
Hi,

I am trying to delete a row with the same code in the Telerik code sample, but my DataKeyValues is always empty.

Here is my code:

<telerik:RadGrid ID="gridNouvOrdo" runat="server" CellSpacing="0" GridLines="None">
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <ClientSettings>
        <Selecting CellSelectionMode="None"></Selecting>
    </ClientSettings>
    <MasterTableView CommandItemDisplay="Top">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
                ButtonType="ImageButton" EditText="Modifier" Resizable="False" HeaderStyle-Width="46px"
                EditImageUrl="Images/Icons/006-Write-New-Icon.png">
                <HeaderStyle Width="32px"></HeaderStyle>
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn CommandName="Delete" ConfirmText="Êtes-vous sûr de vouloir supprimer?"
                FilterControlAltText="Filter column column" Text="Supprimer" UniqueName="colDelete"
                ButtonType="ImageButton" ImageUrl="Images/Icons/059-Close-Delete-circle-Icon.png"
                ConfirmDialogType="Classic">
                <HeaderStyle Width="32px"></HeaderStyle>
            </telerik:GridButtonColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colMedicament column" HeaderText="Médicament"
                UniqueName="colMedicament" DataField="NomMedicament">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colPoso1 column" HeaderText="Posologie 1"
                UniqueName="colPoso1" DataField="Posologie">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colPoso2 column" HeaderText="Posologie 2"
                UniqueName="colPoso2" DataField="Posologie2">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colQte column" HeaderText="Qté."
                UniqueName="colQte" ShowFilterIcon="false" DataField="Quantite">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colRen column" HeaderText="Ren."
                UniqueName="colRen" ShowFilterIcon="false" DataField="Renouvellements">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colComment column" HeaderText="Commentaire"
                UniqueName="colComment" DataField="Commentaire">
            </telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

Protected Sub gridNouvOrdo_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles GridNouvOrdo.NeedDataSource
        gridNouvOrdo.DataSource = CurrentPropsBCM.OrdosManuelles
End Sub
 
Protected Sub gridNouvOrdo_DeleteCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles GridNouvOrdo.DeleteCommand
    Dim id = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)
 
End Sub

My DeleteCommand event currently do nothing, because it fail on the single line with a IndexOutOfBound.

Am I missing something? Thanks.
Shinu
Top achievements
Rank 2
 answered on 06 Jun 2012
0 answers
87 views
i have a radgrid within a radajaxpanel within an ajax control toolkit tab which is populated based upon the selection of a row from another tab. when i click to the first described grid, selection fails even though selection is enabled. when i click a row's edit button and then cancel, selection works.

the insert row button has been redefined to open a radwindow to select a row to populate the parent grid:
<CommandItemTemplate>
      <a href="#" onclick="return openWin();">Add New Registrant</a> <a href="#"
           onclick="return refreshGrid();" style="float: right">Refresh</a>
</CommandItemTemplate>

this alteration shouldn't matter but i have included it in the event that it does.

why does the grid not select when first loaded? i have seen at 2 other threads on this subject without any obvious resolution.




tony
Top achievements
Rank 1
 asked on 06 Jun 2012
0 answers
103 views
I am using client side binding to the grid. When I first load the page, I get a single call to my GetData() web service method as expected. If I click a number in the pager, however, I get the first call and data returned as expected, but then the grid calls the data function again and reloads the data with the parameters set as though the first page is being requested, which means the grid can never show pages other than the first page.

Your documentation has guidance on how to keep this from happening, but I have not been able to get any of the techniques to work:

http://www.telerik.com/help/aspnet-ajax/grid-custom-paging.html

I also tried this technique:

http://demos.telerik.com/aspnet-ajax/grid/examples/client/declarativedatabinding/defaultcs.aspx

But for some reason my GetDataAndCount() web service method was never called. The example does not say how the ClientSettings DataBinding properties should be set in this instance, so that might be the problem. How should they be set? Are there any other properties on the grid that need to be set to make this work, or is there a way to tell from the client side object model that the grid is calling the client side data binding function for the second time so that the argument can be set to cancel?

Another related question: I can use

sender.get_masterTableView().get_columns()[0].set_visible(false);
sender.get_masterTableView().get_columns()[0].Display = false;

to hide a column client side during the data binding call. But if I set

sender.get_masterTableView().get_columns()[0].set_visible(true);
sender.get_masterTableView().get_columns()[0].Display = true;

the column does not reappear. Is there another function I should be calling, or should this be done during another event? I would like to manage the visibility of certain columns client side. Is this possible?
John
Top achievements
Rank 1
 asked on 06 Jun 2012
0 answers
107 views
I would like to nest a RadGrid within the ItemTemplate/AlternatingItemTemplate of a RadListView and then use a ListView dataitem as a variable for the select statement that populates the RadGrid datasource.

For example:
______________________________________________
User Name: jdoe
First Name: John
Last Name: Doe
______________________________________
|_UserName__|__Workstation__|_LastLogOn_|
|     jdoe           |   PC103              |     8:00 am   |
______________________________________

______________________________________________
User Name: ssmith
First Name: Sally
Last Name: Smith
______________________________________
|_UserName__|__Workstation__|_LastLogOn_|
|      ssmith       |           PC107     |     8:05 am   |
______________________________________

______________________________________________


Is this possible?


Allan
Top achievements
Rank 2
 asked on 05 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?