Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
36 views
test
Stanimir
Telerik team
 answered on 22 Apr 2009
1 answer
152 views
I have a small grid with just two columns, Id and User. I have changed the grid's look and feel so that the Add can be done through a seperate button and it works. The grid has two editcolumns Edit and Delete. Delete works fine too. Clicking the edit button brings up the inplace edit boxes, but they are blank. Why am I missing those values? Here is my code for the grid definition and teh code behind for it.

The datasource is a datatable with three columns Id, User and Type.

<telerik:RadGrid ID="grdUsers" runat="server" runat="server" AllowAutomaticUpdates="True" ShowHeader="False"
                OnNeedDataSource="grdUsers_NeedDataSource" OnPreRender="grdUsers_PreRender"
                AutoGenerateColumns="False" GridLines="None"
                Height="100px" Width="400px" OnItemCommand="grdUsers_ItemCommand" SkinID="WithBorder">
                 <HeaderContextMenu EnableTheming="True">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </HeaderContextMenu>
                <MasterTableView AutoGenerateColumns="False" ClientDataKeyNames="Id" EditMode="InPlace">
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton"
                            HeaderStyle-Width="30px" UniqueName="EditCommandColumn">
                        </telerik:GridEditCommandColumn>
                        <telerik:GridBoundColumn DataField="Id" UniqueName="Id" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="User" UniqueName="User">
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete"
                            ConfirmDialogType="RadWindow" ConfirmText="Delete this entry?"
                            ConfirmTitle="Delete" HeaderStyle-Width="50px" Text="Delete"
                            UniqueName="DeleteColumn">
<HeaderStyle Width="50px"></HeaderStyle>

                            <ItemStyle CssClass="" HorizontalAlign="Center" />
                        </telerik:GridButtonColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings>
                    <Scrolling AllowScroll="True" />
                </ClientSettings>
                <FilterMenu EnableTheming="True">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </FilterMenu>
            </telerik:RadGrid>

protected void grdUsers_ItemCommand(object source, GridCommandEventArgs e)
        {
            GridEditableItem editItem;
            switch (e.CommandName)
            {
                case (RadGrid.DeleteCommandName):
                    editItem = e.Item as GridEditableItem;
                    DeleteItem(editItem);
                    grdUsers.Rebind();
                case RadGrid.UpdateCommandName:
                    if (e.Item is GridEditableItem)
                    {
                        editItem = e.Item as GridEditableItem;
                        UpdateItem(editItem);
                        grdUsers.Rebind();
                    }
                    break;
            }
        }

        protected void grdUsers_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            if (ViewState["dTable"] != null)
            {
                dTable = (DataTable)ViewState["dTable"];
                grdUsers.DataSource = dTable;
            }
        }
Thanks,
Vithiya





Nikolay Rusev
Telerik team
 answered on 22 Apr 2009
1 answer
196 views
I'm in the process of evaluating Telerik and have encountered some difficulty integrating with the Microsoft MVC framework. Is there any list of know issues or constraints regarding the integration of Telerik and the MVC framework? It would be a great help in determining where we will need to look for a workaround or custom code. An example of a limitations I've come across are exporting data in a grid to an Excel spreadsheet or using Ajax.ActionLink() to render Ajax enabled links in the table header for partial page refresh on sorting a column.

Your comments and feedback will be appreciated.

Thank you, Brian

 

Paul
Telerik team
 answered on 22 Apr 2009
1 answer
215 views
Hi

I have a simple login form inside a radajaxpanel, plus a separate button and a loading panel.
These are all within another main radajax panel which declares the loading panel.
On button click, the sub to check the database fires and the login proceeds OK.
There is no sign of the loading panel though, at least while it runs on my local machine.

I set the loading panel to run after min delay of 10 and to run for 1000 .   Should this run
or might the event be all over in 10 msecs (but it is the same if delay is 0)?

I tried inserting a 3 second sleep in the button click sub, but it still doesn't show.

Also added an Ajax manager and set button to trigger the main panel and the loading panel
but it didn't change anything

I am puzzled because I have a similar set up working, althought it writes to the database so it takes
a bit longer.

Can you give me some ideas on how to find out why it the loading panel doesn't show. There are no error messages.

Is there an event that i could add some delay to, to check that it will show when running on the production
server?

Thanks

Clive


Yavor
Telerik team
 answered on 22 Apr 2009
1 answer
103 views
Hi
      I called the user control with in rad grid.  The User Control to have associated Drop down Like wise Country, state, City...
If i Selected the Destination. that time the state Loaded but the the first drop down(Destination is post back) and show the precious data. I want to need Proper  association   Let me know how can i handled this problem


My Code is
   /// <summary>
        /// Load Destination Data From DataBase
        /// </summary>
        public void LoadDestinationFromDB()
        {
            try
            {
                IList<AreaData> areaSearch = new List<AreaData>();
                areaSearch = areaManager.GetDestinations();
                cmbMasterInfoDestination.DataSource = areaSearch;
                cmbMasterInfoDestination.DataTextField = "Name";
                cmbMasterInfoDestination.DataValueField = "ID";
                cmbMasterInfoDestination.DataBind();

                RadComboBoxItem cmbParentArea = new RadComboBoxItem();
                cmbParentArea.Text = " ";
                cmbMasterInfoDestination.Items.Insert(0, cmbParentArea);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }



        /// <summary>
        /// Load the Sub Area Details From Database
        /// </summary>
        /// <param name="o">Destination ID</param>
        /// <param name="e"></param>
        protected void cmbMasterInfoDestination_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            JSSessionHandler.SetSessionValue("PropertyDestination", "5");
            if ((cmbMasterInfoArea.SelectedIndex != 0) && (cmbMasterInfoDestination.SelectedIndex != 0))
            {
                IList<AreaData> subAreaData = new List<AreaData>();
                subAreaData = areaManager.GetSubArea(Convert.ToInt64(cmbMasterInfoDestination.SelectedValue));
                cmbMasterInfoArea.DataSource = subAreaData;
                cmbMasterInfoArea.DataTextField = "Name";
                cmbMasterInfoArea.DataValueField = "ID";
                cmbMasterInfoArea.DataBind();

                RadComboBoxItem cmbSubArea = new RadComboBoxItem();
                cmbSubArea.Text = " ";
                cmbMasterInfoArea.Items.Insert(0, cmbSubArea);
            }

            if ((cmbMasterInfoDestination.SelectedIndex == 0) || (cmbMasterInfoDestination.SelectedIndex == -1))
            {
                cmbMasterInfoArea.Items.Clear();
                cmbMasterInfoLocation.Items.Clear();
            }

        }

        /// <summary>
        /// Load the Location Details From DataBase
        /// </summary>
        /// <param name="o">Area Id</param>
        /// <param name="e"></param>
        protected void cmbMasterInfoArea_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            if ((cmbMasterInfoLocation.SelectedIndex != 0) && (cmbMasterInfoArea.SelectedIndex != 0))
            {
                IList<AreaData> locationData = new List<AreaData>();
                locationData = areaManager.GetChildArea(Convert.ToInt64(cmbMasterInfoArea.SelectedValue));
                cmbMasterInfoLocation.DataSource = locationData;
                cmbMasterInfoLocation.DataTextField = "Name";
                cmbMasterInfoLocation.DataValueField = "ID";
                cmbMasterInfoLocation.DataBind();

                RadComboBoxItem cmbLocation = new RadComboBoxItem();
                cmbLocation.Text = " ";
                cmbMasterInfoLocation.Items.Insert(0, cmbLocation);
            }

            else
            {
                cmbMasterInfoLocation.Items.Clear();
            }
        }







Regards
G. Manikandan
Yavor
Telerik team
 answered on 22 Apr 2009
2 answers
159 views
Hi all,

How to know what version of Telerik has been installed on the PC(including the major and minor build version) ?

Appreciate your assistance.

Thanks
Amry Hanitijo
Top achievements
Rank 1
 answered on 22 Apr 2009
1 answer
139 views
I have the latest release (Q1 2009 SP1).  I have node text editing enabled.  How do I disable this for certain nodes?  It looks like from the examples/articles I looked at there used to be a way to do this, but those methods are no longer available?
Princy
Top achievements
Rank 2
 answered on 22 Apr 2009
1 answer
316 views
I recently changed from using the radgrid contol for .NET2.0 to the 3.5 control.  But now I've noticed that my delete is not working.  When I click the delete button, the record is removed from the grid but the RadGrid1_DeleteCommand method is never called.  But it is called when the RebindGrid button is clicked.  I also have the same problem when delete from a grid where the delete command is defined in the datasource and there is no delete command method in the code behind.  I'm not sure if I'm doing something wrong or if something changed between the 2 versions.  I'm not having any problems with insert or update.

<

 

asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.gif" />

 

Refresh Allocation list

</asp:LinkButton>

 

...

<

 

radG:GridClientDeleteColumn ConfirmText="Delete this Project?" ButtonType="ImageButton"

 

 

ImageUrl="Images\Delete.gif" CommandName="Delete" Text="Delete"

 

 

UniqueName="DeleteColumn">

 

 

<HeaderStyle Width="16px" />

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</radG:GridClientDeleteColumn>
...

 

 

protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)

 

{

 

if (e.CommandName == RadGrid.DeleteCommandName)

 

{

 

string ProjectId = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ProjectId"].ToString();

 

 

string Resource = e.Item.OwnerTableView.Items[e.Item.ItemIndex]["Resource"].ToString();

 

 

string Role = e.Item.OwnerTableView.Items[e.Item.ItemIndex]["Role"].ToString();

 

 

string Year = e.Item.OwnerTableView.Items[e.Item.ItemIndex]["Year"].ToString();

 

AllocationsDataSource.DeleteCommandType =

SqlDataSourceCommandType.StoredProcedure;

 

AllocationsDataSource.DeleteCommand =

"RAT_OWNER.DeleteAllocations";

 

AllocationsDataSource.DeleteParameters.Clear();

AllocationsDataSource.DeleteParameters.Add(

"ProjectId", ProjectId);

 

AllocationsDataSource.DeleteParameters.Add(

"Resource", Resource);

 

AllocationsDataSource.DeleteParameters.Add(

"Role", Role);

 

AllocationsDataSource.DeleteParameters.Add(

"Year", Year);

 

RadGrid1.Rebind();

}

}




Shinu
Top achievements
Rank 2
 answered on 22 Apr 2009
1 answer
103 views
I am working on the HowToModalDialog in the tutorial. The ContactDetails InitializeDialog function is not being called when the AddressDialog is shown.
Fiko
Telerik team
 answered on 22 Apr 2009
0 answers
97 views
I have a problem that I can't solve and need you help.

I call function BeforeClientDrop(sourceNode, destNode)  and set it return false  to delay state drop from treeview. After I do some thing  example click a button . I want that tree cotinue drop that node.
I want to ask that , How can I make function radtreeview_nodedrop  continue  execute after I click  a button?
Thanks very much!
piro
Top achievements
Rank 1
 asked on 22 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?