Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
91 views
In our grid, the master table view has a detailed table view. So for each row in the master table, there is a detailed table. When expanding the detailed table, the background color in some cells of the parent item will be changed based on some logic in the ItemDataBound event handler. My question is, is it possible to change the background color in the parent cells when collapsing a detailed table? I tried in ItemCreated event handler but got no luck. Looks like it is always using the viewstate to render the grid. Any thoughts? Thanks a lot!
Ted
Top achievements
Rank 1
 answered on 18 Nov 2008
2 answers
147 views
Does anyone know how to implement adjacent toolbars? I would like to create an interface like the CommandItemTemplate example (http://demos.telerik.com/ASPNET/Prometheus/ToolBar/Examples/ApplicationScenarios/GridCommandItem/DefaultVB.aspx?product=toolbar), however, I need to place toolbuttons on both the left and right side of the grid header. In other words, I have a set of commands which are left justified, and another set which are right justified. I can probalby put something togetther using css layout, or even tables, however, I want it ot look like a single toolbar, stretching the avaialble width, rather than two distinct toolbars.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
 answered on 18 Nov 2008
1 answer
78 views
Hi,

We encounter "An unexpected error occurs" when RadAjaxManager is enable, otherwise all is ok.

Things we do:-
*1.  SmartPart.
*2. User Control in Share Point.

3.  RadAjaxManager.

We noted that there is no example provided from Telerk which is running on SmartPart and using User Control.


Please let us know if any one ever attempt this before.

Thanks.

Warm Regards,
Lee Peng Hock


Nikolay Rusev
Telerik team
 answered on 18 Nov 2008
2 answers
123 views
Is there anyway to just use the managers for example:

Just use the document manager instead of using the whole Rad Editor, i think the manager tools are very useful and just want a Document Manager not the full editor.
Ian
Top achievements
Rank 1
 answered on 18 Nov 2008
3 answers
169 views
Hi,

I was testing my work using https and it seems that the control is performing a http get on a gif on the control.
When I used a sniffer, I found this file doing an http get
http 200
host: wwww.telerik.com
url:/help/aspnet-ajax/images/copycode.gif

It seems it is only happening on IE6 but not on IE7. This is causing my website to prompt for secure and nonsecure items.

thanks.
Rumen
Telerik team
 answered on 18 Nov 2008
3 answers
153 views
Hello,

Being new to Telerik, I wasn't sure how I could incorporate two fields: one being a drop down of values, and one being a checkbox into the Telerik Scheduler's Advanced Insert/Edit form...  I was looking at some of the examples, but couldn't figure it out successfully.  Any input would be great.

Thanks.
Peter
Telerik team
 answered on 18 Nov 2008
1 answer
199 views
Hi

We have added the document manager to our toolsfile.xml - 
    <tool name="DocumentManager"/> - and are using this to allow content editors to add links to documents in the site collection documents library.  They can also upload documents if needed.  When the link is added to the page it adds the following markup:

<a href="/sites/sitename/SiteCollectionDocuments/somedocument.pdf">somedocument.pdf</a>

What we would like to do is expand of the markup that is added to do the following:
  • Add an appropriate image befoere the links (pfd icon, word icon etc)
  • Add the document file size

The markup added would ideally be

<img src="/sites/sitename/Style%20Library/en-us/Images/icon_pdf.gif" alt="PDF Icon" title="PDF Icon" /><a href="/sites/sitename/SiteCollectionDocuments/somedocument.pdf" title="somedocument.pdf">somedocument.pdf</a> (32kb)

Is it possible to amend the functionality of the Document Manager to capture/add the extra information to the markup that is return? Or is there any existing functionality that we can use?

We are currently using version 5.2.0.0 of the editor.

Thanks
Peter
Stanimir
Telerik team
 answered on 18 Nov 2008
1 answer
160 views
Hello

I'm using RadGrid Q3 2008, I've placed 2 grids on a page and enabled client side multi selecting, I need to move all selected rows from Grid1 to Grid2, I know that I can create DataTable for each grid and move selected DataRow then bind the grids, but is there any easier way to do this?

Best
Sebastian
Telerik team
 answered on 18 Nov 2008
2 answers
851 views

Hi,

I need a datepicker for when i edit a datetime field in my grid. It should only be possible to choose Month and Year. So from http://www.telerik.com/community/code-library/aspnet-ajax/calendar/month-year-picker.aspx I downloaded this. It works fine as is but i've placed the datepicker into my edittemplate and now i'm getting an error on the line of Javascript

---   var picker = $find("<%= RadDatePicker1.ClientID %>");
I'm guessing because my RadDatePicker1 is buried in the edittemplate. Is there a better way to use the DatePicker so i have Month/Year only or is this a good approach? If so how to reference the control?


For interest here's my column
                <telerik:GridTemplateColumn HeaderText="Period Start" DataType="System.DateTime">
                    <EditItemTemplate>
                        <telerik:RadDatePicker ID="RadDatePicker1" runat="server" Skin="Web20" Width="130px">
                            <DateInput DateFormat="MMMM yyyy" LabelCssClass="radLabelCss_Web20" Skin="Web20">
                            </DateInput>
                            <Calendar Skin="Web20">
                                <FastNavigationSettings TodayButtonCaption="current date" />
                            </Calendar>
                        </telerik:RadDatePicker>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <%#Eval("StartMonth")%>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
If you don't wanna download the datepicker from that link here is the code which provides the Month/Year only functionality:

    <script type="text/javascript">
        //override the onload event handler to change the picker after the page is loaded
        window.onload = function() {
            window.setTimeout(function() { SetCalendarTable(); }, 200)
        }

        function SetCalendarTable() {

            var picker = $find("<%= RadDatePicker1.ClientID %>");
            var calendar = picker.get_calendar();
            var fastNavigation = calendar._getFastNavigation();

            $clearHandlers(picker.get_popupButton());
            $addHandler(picker.get_popupButton(), "click", function() {
                //debugger;   
                var textbox = picker.get_textBox();
                //adjust where to show the popup table
                var x, y;
                var adjustElement = textbox;
                if (textbox.style.display == "none")
                    adjustElement = picker.get_popupImage();

                var pos = picker.getElementPosition(adjustElement);
                x = pos.x;
                y = pos.y + adjustElement.offsetHeight;

                var e = {
                    clientX: x,
                    clientY: y
                };
                //synchronize the input date if set with the picker one
                var date = picker.get_selectedDate();
                if (date) {
                    calendar.FocusedDate[0] = date.getFullYear();
                    calendar.FocusedDate[1] = date.getMonth() + 1;
                }

                $get(calendar._titleID).onclick(e);
            });

            fastNavigation.OnOK =
                    function() {
                        var date = new Date(fastNavigation.Year, fastNavigation.Month, 1);
                        picker.get_dateInput().SetDate(date);
                        fastNavigation.Popup.Hide();
                    }

            fastNavigation.OnToday =
                    function() {
                        var date = new Date();
                        picker.get_dateInput().SetDate(date);
                        fastNavigation.Popup.Hide();
                    }
        }  
    </script>

Daniel
Telerik team
 answered on 18 Nov 2008
5 answers
237 views
Hi,

I have 3 combo boxes. When an item is selected in the first, the second is populated. When an item in the second is selected the third is populated. This all works fine until the page is posted back where the SelectedValues for the second and third combos have not changed from what they were initally set to when the page is loaded.

The 3 combos and client side script look like:

 

<telerik:RadComboBox runat="server" ID="cboCopyFromTariff" Width="250" OnClientSelectedIndexChanged="cboCopyFromTariff_ClientSelectedIndexChanged" />
<telerik:RadComboBox runat="server" ID="cboCopyFromVersion" Width="250" OnClientSelectedIndexChanged="cboCopyFromVersion_ClientSelectedIndexChanged" OnClientItemsRequested="cboCopyFromVersion_ClientItemsRequested"/>
<telerik:RadComboBox runat="server" ID="cboCopyFromTable" Width="250" OnClientItemsRequested="cboCopyFromTable_ClientItemsRequested" />

function cboCopyFromVersion_ClientItemsRequested(sender, eventArgs) { 
    
var items = sender.get_items();
    if (items.get_count() > 0)
        items.getItem(0).select();
}

function cboCopyFromTable_ClientItemsRequested(sender, eventArgs) { 
    
var items = sender.get_items(); 
    
if (items.get_count() > 0) 
        items.getItem(0).select();
}

And the server side code looks like this:

private
void cboCopyFromVersion_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
    
int tariffId = 0;
    
int.TryParse(e.Text, out tariffId); 
    LoadCopyFromVersions(tariffId);
}

private void cboCopyFromTable_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
    
int tariffVersionId = 0; 
    
int.TryParse(e.Text, out tariffVersionId); 
    LoadCopyFromTables(tariffVersionId);
}

        
private void LoadCopyFromVersions(int tariffId)
        {
            cboCopyFromVersion.Items.Clear();
            if (tariffId > 0)
            {
                var versions =
                    from v in this.DataContext.TariffVersionSet
                    where v.Tariff.TariffId == tariffId
                    orderby v.StartDate descending
                    select v;

                cboCopyFromVersion.Items.Clear();
                cboCopyFromVersion.DataValueField = "TariffVersionId";
                cboCopyFromVersion.DataTextField = "Description";
                cboCopyFromVersion.DataSource = versions.ToList();
                cboCopyFromVersion.DataBind();

                //Default to the TariffVersion passed
                if (cboCopyFromVersion.Items.Count > 0)
                {
                    int TariffVersionId = this.TariffVersion.TariffVersionId;
                    if (cboCopyFromVersion.Items.FindItemByValue(TariffVersionId.ToString()) != null)
                        cboCopyFromVersion.SelectedValue = TariffVersionId.ToString();
                    else
                        cboCopyFromVersion.SelectedIndex = 0;
                    LoadCopyFromTables(int.Parse(cboCopyFromVersion.SelectedValue));
                }
                else
                    LoadCopyFromTables(0);
            }
            else
                LoadCopyFromTables(0);

        }

        private void LoadCopyFromTables(int tariffVersionId)
        {
            cboCopyFromTable.Items.Clear();

            if (tariffVersionId > 0)
            {
                var tables =
                    from tt in this.DataContext.TariffTableSet
                    where tt.TariffVersion.TariffVersionId == tariffVersionId
                    orderby tt.Description descending
                    select tt;

                cboCopyFromTable.DataValueField = "TariffTableId";
                cboCopyFromTable.DataTextField = "Description";
                cboCopyFromTable.DataSource = tables.ToList();
                cboCopyFromTable.DataBind();

                //Default to the latest TariffVersion for the selected Tariff
                if (cboCopyFromTable.Items.Count > 0)
                    cboCopyFromTable.SelectedIndex = 0;
            }
        }

The problem occurs in the Save button's click handler:

 

        protected void btnSave_Click(object sender, EventArgs e)
        {
            EF.TariffTable table;

            if (optCopyTable.Checked && cboCopyFromTable.SelectedIndex > -1)
                table = CopyTariffTable(int.Parse(cboCopyFromTable.SelectedValue));
            else
                table = CreateEmptyTariffTable();

        }

When a new item is selected in the first combo the second combo correctly displays the first item filtered by the first's selection. And the third combo correctly shows the first item correctly filtered by the second.

However in the Save button handler the SelectedValue of the third combo (cboCopyFromTable)  does not match what is displayed as selected.

I have read similar forum posts for previous versions of RadCombo and they suggest using the "Value" property instead of "SelectedValue", but the ASP.NET AJAX version doesn't have this property.

The help file article ms-help://telerik.aspnetajax.radcontrols.2008.Q2/telerik.aspnetajax.radcombobox.2008.Q2/load-on-demand-additional-attributes.html suggests a way of linking two combos together but it depends on EnableLoadOnDemand to be true. This is not suitable for my solution as there are few items in each combo and I don't want the user to be able to type in the box.

Can anyone suggest how to fix this so that the server side code is aware of the changes made during the AJAX callbacks?

Many thanks,
Jason Steele

 

Simon
Telerik team
 answered on 18 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?