ListItemCollection.AddRange sets selection to the first item

I have a custom DropDownList derived from System.Web.UI.WebControls.DropDownList.
And I’ve noticed that after populating data using
ListItemCollection.AddRange Method,
the DropDownList.SelectedIndex Property becomes set to 0 from -1.

I consider this as an unexpected behavior and have to change it back to -1- unselected.

            Items.Clear();

            Debug.Assert(SelectedIndex == -1);

            Items.AddRange(cachedItems);

            Debug.Assert(SelectedIndex == 0);//is it correct?

Advertisements

Customize remoteoutlook Main Menu

Our company uses remoteoutlook  fro MS Small Business Server 2003. It has Main Menu page, which has a few links, including access to SharePoint. We installed new SharePoint 3. on the different server., and I was asked to change links to a new sharepoint site. Outlook doesn’t support this kind of customization out-of-the box.
It uses ASp.NET web site with client.aspx file, showing Main Menu. But the actual code is compiled into Remote.dll storing in bin folder and is not available for modification(using Reflector I found, that they generate link using some registry SPS settings).
But the fix was simple. I’ve copied the generated html from the browser and added it to aspx file. In the href attribute I’ve added link to the new site. I’ve hidden existing rows with server controls using html comments
<!– –>.
See the changed section of the code below.

Similar changes were done for admin.aspx as well.

 <!–<TR>

                                <TD width=”30″></TD>
                                <TD vAlign=”center” align=”middle” width=”45″ rowSpan=”2″><asp:linkbutton TabIndex=”-1″ id=”linkIntranetImg” runat=”server”><IMG alt=”” src=”images/compint.gif” border=”0″></asp:linkbutton></TD>
                                <TD class=”linkHeader”><asp:linkbutton TabIndex=”6″ id=”linkIntranet” runat=”server”></asp:linkbutton></TD>
                            </TR>
                            <TR>
                                <TD width=”30″></TD>
                                <TD class=”linkText”><%=rapLinks.loadResString(“L_CLIENT_STSLINK_DESC”)%></TD>
                            </TR>
                        –>
                            <TR>
                                <TD width=”30″></TD>
                                <TD vAlign=”center” align=”middle” width=”45″ rowSpan=”2″><a id=”linkIntranetImg” tabindex=”-1″ href=”href://NewServerUrl/”><IMG alt=”” src=”images/compint.gif” border=”0″></a></TD>
                                <TD class=”linkHeader”><a id=”linkIntranet” tabindex=”6″ href=”href://NewServerUrl/”>Use my company’s internal Web site</a></TD>
                            </TR>
                            <TR>
                                <TD width=”30″></TD>
                                <TD class=”linkText”>View, create, and edit documents and announcements on the site.</TD>
 
Another approach is described in Companyweb & Sharepoint v3 – Part 5  blog post.