Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
107 views
Hello !

I needed a RadGrid with possibility to change data in it without pressing any Edit buttons, so i added textboxes and Save/Delete buttons directly to ItemTemplates, also added  CommandItemDisplay="Top" to insert new rows, as a result  RadGrid looks like this:

    <telerik:RadGrid ID="gvwEducations" runat="server" GridLines="None" OnItemDataBound="gvwEducations_ItemDataBound"
        AutoGenerateColumns="False" OnItemCommand="gvwEducations_ItemCommand">
        <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" EditMode="InPlace">
            <Columns>
                <telerik:GridTemplateColumn UniqueName="IntstituteTemplate" HeaderText="Institute">
                    <ItemTemplate>
                        <telerik:RadComboBox ID="cbxInstitute" runat="server">
                        </telerik:RadComboBox>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadComboBox ID="cbxInstitute" runat="server">
                        </telerik:RadComboBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>

                <telerik:GridTemplateColumn UniqueName="StartTimeTemplate" HeaderText="Start">
                    <ItemTemplate>
                        <telerik:RadTextBox ID="tbxStartYear" runat="server">
                        </telerik:RadTextBox>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadTextBox ID="tbxStartYear" runat="server">
                        </telerik:RadTextBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>

                <telerik:GridButtonColumn CommandName="Save" Text="Save" UniqueName="SaveColumn"
                    ShowInEditForm="true">
                </telerik:GridButtonColumn>
                <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"
                    ShowInEditForm="true">
                </telerik:GridButtonColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

Here comes the questions :)
is it possible to use ItemTemplate on item insert ?(at the moment edititemtemplate is just copypaste of itemtemplate) 



and one more questions about codebehind :

        protected void gvwEducations_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                RadComboBox cbxInstitute = (RadComboBox)e.Item.FindControl("cbxInstitute");
                RadTextBox tbxStart = (RadTextBox)e.Item.FindControl("tbxStartYear");
                cbxInstitute.DataSource = SomeCacheDatasource;
   cbxInstitute.DataBind();

                if (e.Item.DataItem is MyDataType)
                {
//fill textboxes with data from datasource
                }
            }
            if (e.Item is GridEditFormInsertItem) //if inserting new item, fill comboboxes
            {
                RadComboBox cbxInstitute = (RadComboBox)e.Item.FindControl("cbxInstitute");
                cbxInstitute.DataSource = SomeCacheDatasource;
                cbxInstitute.DataBind();

            }
        }

        protected void gvwEducations_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "Save")
            {
                SaveData(e);
            }
        }

when i save newly added item in gvwEducations_ItemCommand all it's controls values exist but they are empty,
am i doeing something wrong ?


Thank you !

Aleksei
Top achievements
Rank 1
 answered on 04 Aug 2009
1 answer
45 views
Hello;

I'm trying to link in the Default2006 skin for an app that I'm upgrading to Q2 2009 -- I know the skin is deprecated, but it's simple style is one our users prefer for some application without the extra graphic elements and padding of some of the newer skins.  I've downloaded the Q3 2008 ConvertedSkins.zip file, and hooked up the following to my page:

 

 

        <link type=text/css rel=stylesheet href="/RadControls/LegacySkins/Default2006/Grid.Default2006.css">  
        <link type=text/css rel=stylesheet href="/RadControls/LegacySkins/Default2006/Menu.Default2006.css">  
        <link type=text/css rel=stylesheet href="/RadControls/LegacySkins/Default2006/Input.Default2006.css">  
        <link type=text/css rel=stylesheet href="/RadControls/LegacySkins/Default2006/Calendar.Default2006.css">  
 

EnableEmbeddedSkins is set to false, and the Skin for the grid is set to Default2006.

Everything works pretty well - the grid appears as I would expect, and the dropdown menus for the filter are fine.  The pager control generally looks and behaves, with the exception of the menu that lets you control page size.  The menu is unformatted, unstyled text when it pops up and the options aren't selectable.  Instead of an image to open the option list, there is simply the word "Select".

Can anybody offer any suggestions as to what I'm missing?  I'm sure it's something simple.

Thanks in advance,
Jason

Dimo
Telerik team
 answered on 04 Aug 2009
2 answers
70 views
When grouping data i am also getting the GroupField name i dont want it, i just need the value.

Thanks a million in advance.
Ali Akbar
Top achievements
Rank 1
 answered on 04 Aug 2009
1 answer
94 views
I've created an ASCX control which uses a radToolBar and radGrid, and have then created a redistributable version of the control using the technique described here:

http://msdn.microsoft.com/en-us/library/aa479318.aspx

This works really well except that the skin setting does not work. It works fine in the test project I used to create/test/publish the control, so it must be something to do with how the control is referencing skins - maybe the path to the Skins folder?

I've added a Skin property to the control, and am passing this to the underlying controls as follows:

    private string _Skin;  
    public string Skin  
    {  
        get { return _Skin; }  
        set 
        {  
            _Skin = value;  
            RadToolBar1.EnableEmbeddedSkins = false;  
            RadToolBar1.Skin = _Skin;  
 
            RadGrid1.EnableEmbeddedSkins = false;  
            RadGrid1.Skin = _Skin;  
        }  
    }  
 

In the project where I'm using the control, its assembly is added as a reference - I'm wondering whether I need to move the control's assembly under this project's directory structure in order for it to pick up the skin properly

Any thoughts?

Thanks,

James
Schlurk
Top achievements
Rank 2
 answered on 04 Aug 2009
3 answers
197 views
Does anybody know how to get the image source path in the DeleteFile function of DBContentProvider.cs?

We have a table with all of the image names and paths in the database.  When a user uploads a new image we rename it from "MyFirstPic.jpg" to 25.jpg, where 25 is the picture id in the database.  We store the original name so that the user can see it when they look through the image manager.

I am adding code to the DeleteFile function but the variable that is getting passed is the image path with the old image name (MyFirstPic.jpg) not the new (25.jpg).  How do I get the actual name (25.jpg)?  
Thanks

Fiko
Telerik team
 answered on 04 Aug 2009
4 answers
256 views
Hi,

we have a big amount of Rad/ASP.NET AJAX Controls on our website. Some of them are managed by RadAjaxManager. Now when we debug the application with FireBug, we recognized that on each Ajaxified Postback there will be a POST which contains dynamic data from all controls used on the site (maybe to keep the server side up to date, Values, VIEWSTATE,... ) But this POST has a size of mminimum 500KB And we still have to add much more controls to the website.
Currently if 10 controls produce postbacks that would mean that the Client will post 5MB of Data to the server (Not at the same time). this results in a slow behavior :-(

Is this behavior configurable ?
Is it possible to transfer just the data of the current control?


thank you for answer

regards

Jürgen
ManniAT
Top achievements
Rank 2
 answered on 04 Aug 2009
1 answer
68 views
I have tried demo for feature grid reordering column and I found a bug after I did the step below.

1. Resize any column width to be 0 - 10 pixels
2. Resize again to be 15 or more
3. The white bar will appear beside the resized column.

I tested on IE8.

Best regards,
Visoot

Pavlina
Telerik team
 answered on 04 Aug 2009
3 answers
228 views
Hi, All,
        I'm a new user. Today, I meet an issue just now. I need your help. Thanks!
        I add one RadSplitter and RadPane dynamic then I set RadPane's ContentUrl. But when page postback, the content in RadPane clear. Does anybody knows why? The following is my code about this issue:
        Some code in .aspx:
            <div id ="uxDivTest" runat ="server">
            </div> 
             <asp:Button ID="btnAdd" runat="server" Text="Add Pane" OnClick="btnAdd_Click" />
             <asp:Button ID="btnTest" runat="server" Text="Refresh Page" onclick="btnTest_Click" />

        Some code in .aspx.cs:

            protected void btnAdd_Click(object sender, EventArgs e) {
                       RadSplitter dispositionSplitter = new RadSplitter();
                       RadPane dispositionPanel = new RadPane();
                       dispositionSplitter.ID = "splitter";
                       dispositionPanel.ID = "panel";
                       dispositionPanel.ContentUrl = "http://www.google.com";
                       dispositionSplitter.Items.Add(dispositionPanel);

                       uxDivTest.Controls.Add(dispositionSplitter);
              }
                
                // postback page

              protected void btnTest_Click(object sender, EventArgs e) {

              }

       When I click Add Pane button, openning google in RadPane. That's all right. But when I click Refresh Page button to postback page, RadPane is empty and google site disappear.
       How shoud I make google appear all the time even when page postback?

       Another question: How shoud I add RadSplitter and RadPane dynamic in Client-Side with javascript?

        Thank you again!
         Jguo

Svetlina Anati
Telerik team
 answered on 04 Aug 2009
1 answer
102 views
Hi there,

I want to get the Selected View Start and End Date.
e.g., if Week View is selected then I need to get the Start Date as well as The End Date of Week which is currently displayed in the Scheduler.
Same in Timeline and Month View.
(Note: I am using Q3 2008 version of Telerik library)

Any urgent help in this regard will be really appriciated.

Thanks
Sajid Wahab
Peter
Telerik team
 answered on 04 Aug 2009
2 answers
211 views
Hi,
I am using two listboxes with a finish button, I want to clear the selection in the first list box in the SelectedIndexChanged client side event of second listbox and viceversa, below is the code.
 <script language="javascript" type="text/javascript">

 

 

function ExistingonSelectedIndexChanged(sender, args)

 

 

 {

 

var listbox = $find("<%= lstAvailablePlans.ClientID %>");

 

 

 

listbox.trackChanges();

 

 

 listbox.clearSelection();

listbox.commitChanges();

}

function AvailableonSelectedIndexChanged(sender, args)

 {

 

var listbox = $find("<%= lstExistingPlans.ClientID %>");

 

 

 

listbox.trackChanges();

 

listbox.clearSelection();

listbox.commitChanges();

}

 

</script>

 

 

<table cellpadding="2" cellspacing="2" border="0" class="TableBorder" width="100%">

 

 

<tr valign="top">

 

<td style="width: 105px">&nbsp;</td>

 

<td class="clsLabel">

 

<asp:Label id="lblExisting" runat="server" text="<%$ Resources:pageLabels, lblExistingPlans %>" CssClass="clsLabel"></asp:Label>

 

</td>

 

<td style="width: 100px">&nbsp;</td>

 

</tr>

 

<tr valign="top">

 

<td style="width: 105px">&nbsp;</td>

 

<td>

 

<telerik:RadListBox ID="lstExistingPlans" runat="server" Width="763px" Height="250px" CssClass="clsLable" Skin="Office2007" OnClientSelectedIndexChanged="ExistingonSelectedIndexChanged"></telerik:RadListBox>

 

</td>

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

<tr valign="top">

 

 

<td style="width: 105px">&nbsp;</td>

 

 

<td class="clsLabel">

 

 

<asp:Label id="lblAvailable" runat="server" text="<%$ Resources:pageLabels, lblAvailablePlans %>" CssClass="clsLabel"></asp:Label>

 

 

</td>

 

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

<tr valign="top">

 

 

<td style="width: 105px">&nbsp;</td>

 

 

<td>

 

 

<telerik:RadListBox ID="lstAvailablePlans" runat="server" Width="763px" Height="250px" CssClass="clsLable" Skin="Office2007" OnClientSelectedIndexChanged="AvailableonSelectedIndexChanged"></telerik:RadListBox>

 

</td>

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

</table>

I could able to clear the selection in first listbox on SelectedIndexChanged client event of second list box and vice versa, but the problem is 

1. I select one record in the first list box 
2. Then I select one record in the second list box
3. Then the selection in the first list box goes off and selection the second list box shows
4. when i click on finish button and at the sever side when i try to access the second list box selected count is 1 and also the first list box selected count is 1 even though i have cleared it in the client side.

Kindly let me know how to fix this issue or wheather its a bug?

Regards,

Santhosh

 

 

 

 

santhosh
Top achievements
Rank 2
 answered on 04 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?