EXT.net - Grid Panel via Entity with DropDowns, Dates, Pin Editing and Deletion - model-view-controller

Title sounds like a real mouthful, so let me try to explain this. I'm very strong with grinding out Web Forms and this is my second crack at using a framework and MVC (don't ask about the first one). Start with a table like this:
Title: Milestones
Id int - Auto, PK
Project_Id int - FK, Many Milestones to One Project, Provided static for now
Number int
Name varchar(50)
Status_Id int - FK One Status to One Milestone
PlannedDate date
LatestEstimate date
MilestoneType_ID int - FK One Type to One Milestone
These all sit on an SQL server, are pulled in by an Entity and then are pulled in by an ObjectDataSource, like this:
<asp:ObjectDataSource runat="server" ID="MilestonesObjectSource" SelectMethod="GetByProject"
DeleteMethod="DeleteMilestone" TypeName="TCProjectManagement.Models.MilestonesAddition">
<SelectParameters>
<asp:Parameter DefaultValue="6" Name="ProjectID" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Type="Int32" Name="Id" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Type="Int32" Name="Id" />
<asp:Parameter Type="Int32" Name="Number" />
<asp:Parameter Type="String" Name="Name" />
<asp:Parameter Type="Int32" Name="Status_Id" />
<asp:Parameter Type="DateTime" Name="PlannedDate" />
<asp:Parameter Type="DateTime" Name="LatestEstimate" />
<asp:Parameter Type="Int32" Name="MilestoneType_ID" />
</UpdateParameters>
</asp:ObjectDataSource>
Sofar so good. Data pull seems to work out okay. I've got a couple more Object Sources that deal exclusively with the Foriegn Keys, so I'll skip those since they seem to be working.
The problems I have are attempting to stitch together many examples that don't seem to go together well. My objectives, in no paticular order:
1) Pin Editing: Click a button to edit, click it again to confirm. Rather do this than have somebody infer to double click for a change. Sofar, this sorta works.
2) Drop Downs for Foriegn Keys: While not in edit mode, should display the "Name" field of the FK. While in edit it should be a Drop Down for options (there's only three). This stays blank dispite what I do.
3) Deletion: Press a button to blow away a row. I put the button there but it's a copy of the JS for editing. What do I need to use to have it be deletion?
4) Dates: This doesn't work at all. One of the weird parts is that from the SQL server's type of Date, it gets changed to DateTime in the Entity and stays that way throughout. However, I cannot get the desired control of ext:DateField to cooperate with the provided data since it displays a time and completely blanks out when editing.. I know I'm doing something wrong here.
5) Saving Changes: Not quite sure I set it up right (or at all).
Provisions of Javascript:
<script type="text/javascript">
var pinEditors = function (btn, pressed) {
var columnConfig = btn.column,
column = columnConfig.column;
if (pressed) {
column.pinOverComponent();
column.showComponent(columnConfig.record, true);
} else {
column.unpinOverComponent();
column.hideComponent(true);
}
};
var pinDeleters = function (btn, pressed) { };
</script>
And ASP Code:
<ext:GridPanel ID="MilestonesGridPanel" runat="server" Title="Milestones" Width="1000px"
Height="300px">
<Store>
<ext:Store ID="MilestonesGridStore" runat="server" DataSourceID="MilestonesObjectSource">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="Id" Type="Int" />
<ext:ModelField Name="Number" Type="Int" />
<ext:ModelField Name="Name" Type="String" />
<ext:ModelField Name="Status_Id" Type="Int" />
<ext:ModelField Name="PlannedDate" />
<ext:ModelField Name="LatestEstimate" />
<ext:ModelField Name="MilestoneType_ID" Type="Int" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column ID="IdColumn" runat="server" DataIndex="Id" Text="DBID" Visible="false" />
<ext:ComponentColumn ID="NumberColumn" runat="server" DataIndex="Number" OverOnly="true"
Pin="true" Flex="1" Text="Number" Editor="true">
<Component>
<ext:NumberField ID="NumberColumnNumberField" runat="server" />
</Component>
</ext:ComponentColumn>
<ext:ComponentColumn ID="NameColumn" runat="server" DataIndex="Name" OverOnly="true"
Pin="true" Flex="1" Text="Name" Editor="true">
<Component>
<ext:TextField ID="NameColumnTextField" runat="server" />
</Component>
</ext:ComponentColumn>
<ext:ComponentColumn ID="StatusColumn" runat="server" DataIndex="Status_Id" OverOnly="true"
Pin="true" Flex="1" Text="Status" Editor="true">
<Component>
<ext:ComboBox ID="StatusColumnDropDownBox" runat="server" QueryMode="Local" Editable="false"
StoreID="MilestoneStatusStore" DisplayField="Name" ValueField="ID" EmptyText="Empty" />
</Component>
</ext:ComponentColumn>
<ext:ComponentColumn ID="PlannedDateColumn" runat="server" DataIndex="PlannedDate"
OverOnly="true" Pin="true" Flex="1" Text="Planned Date" Editor="true">
<Renderer Format="Date" FormatArgs="'m/d/y'" />
<Component>
<ext:DateField ID="PlannedDateColumnTextField" runat="server" Format="MM/dd/yyyy"
EmptyText="Empty" />
</Component>
</ext:ComponentColumn>
<ext:ComponentColumn ID="LatestEstimateColumn" runat="server" DataIndex="LatestEstimate"
OverOnly="true" Pin="true" Flex="1" Text="Latest ETA" Editor="true">
<Renderer Format="Date" FormatArgs="'m/d/y'" />
<Component>
<ext:DateField ID="LatestEstimateColumnTextField" runat="server" Format="MM/dd/yyyy"
EmptyText="Empty" />
</Component>
</ext:ComponentColumn>
<ext:ComponentColumn ID="MilestoneTypeColumn" runat="server" DataIndex="MilestoneType_ID"
OverOnly="true" Pin="true" Flex="1" Text="Milestone Type" Editor="true">
<Component>
<ext:ComboBox ID="MilestoneTypeColumnComboBox" runat="server" QueryMode="Local" Editable="false"
StoreID="MilestoneTypesStore" DisplayField="Name" ValueField="ID" EmptyText="Empty" />
</Component>
</ext:ComponentColumn>
<ext:ComponentColumn ID="EditColumn" runat="server" Width="30" PinAllColumns="false"
AutoWidthComponent="false" OverOnly="true" Text="Edit" Sortable="False">
<Component>
<ext:Button ID="EditButton" runat="server" ToolTip="Pin Editors" Icon="Pencil" AllowDepress="true"
EnableToggle="true" Width="25">
<Listeners>
<Toggle Fn="pinEditors" />
</Listeners>
</ext:Button>
</Component>
</ext:ComponentColumn>
<ext:ComponentColumn ID="DeleteColumn" runat="server" Width="30" PinAllColumns="false"
AutoWidthComponent="false" OverOnly="true" Text="Delete" Sortable="False">
<Component>
<ext:Button ID="DeleteButton" runat="server" ToolTip="Delete Milestone" Icon="Delete"
AllowDepress="true" EnableToggle="false" Width="25">
<Listeners>
<Click Handler="#{MilestonesGridStore}.remove(this.parentMenu.dataRecord)" />
</Listeners>
</ext:Button>
</Component>
</ext:ComponentColumn>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel runat="server" Mode="Single">
<Listeners>
<Select Handler="#{DeleteMilestoneGridButton}.enable();" />
<Deselect Handler="if (!#{MilestonesGridPanel}.selModel.hasSelection()) {
#{DeleteMilestoneGridButton}.disable();
}" />
</Listeners>
</ext:RowSelectionModel>
</SelectionModel>
<Buttons>
<ext:Button ID="AddtoMilestoneGridButton" runat="server" Text="Insert" Icon="Add">
<Listeners>
<Click Handler="#{MilestonesGridStore}.insert(0, {}); #{MilestonesGridPanel}.editingPlugin.startEditByPosition({row:0, column:0});" />
</Listeners>
</ext:Button>
<ext:Button ID="DeleteMilestoneGridButton" runat="server" Text="Delete" Icon="Delete"
Disabled="true">
<Listeners>
<Click Handler="#{MilestonesGridPanel}.deleteSelected();
if (!#{MilestonesGridPanel}.hasSelection()) {
#{DeleteMilestoneGridButton}.disable();
}" />
</Listeners>
</ext:Button>
<ext:Button ID="RefreshMilestonesGridButton" runat="server" Text="RefresH" Icon="Reload">
<Listeners>
<Click Handler="#{MilestonesGridStore}.load();" />
</Listeners>
</ext:Button>
<ext:Button ID="SaveMilestoneGridButton" runat="server" Text="Save" Icon="Disk">
<Listeners>
<Click Handler="#{MilestonesGridStore}.sync();" />
</Listeners>
</ext:Button>
</Buttons>
</ext:GridPanel>

Related

how to delete all the line items from the file after the first one

I need to delete all the line items <LineItem> from the file which does not suffice with this requirements:
elements in Line Item : <LineItemNumber V="00000000000000000010" /> and <PurchaseOrderNumber V="0100230946|00010" /> have to be matched, another words in integer Line Item Number would be 10 and Purchase order number after pipe line | would be 10. we need to have only one those line Items which are matching this requirement. Sorry, i'm really bad at describing.
<Transmission>
<InterchangeUsageIndicator V="T" />
<Groups>
<Group>
<GroupSenderID V="CCC" />
<TotalNumberOfShipmentsInGroup V="000005" />
<Documents>
<Document>
<DocumentHeader>
<InvoiceChargeType V="T" />
<DocumentType V="ORDER" />
<DocumentProcessingCode C="00" />
<BOLNumber V="BOL2309460180582136" />
<AlternateQuantities>
<AlternateQuantity Quantity="12.0" UOM="PK" UOMType="SQ" Characteristic="" />
</AlternateQuantities>
<Buyer Name="" Q="ZP" ID="COUSPO001">
<AlternateIDs />
</Buyer>
<Seller Name="" Q="2" ID="CNTR">
<AlternateIDs />
</Seller>
<Parties>
<Party PartyType="SF">
<Name V="SHA" />
<LocationID Q="" ID="" />
<AlternateLocationIDs>
<LocationID Q="" ID="SHA" />
</AlternateLocationIDs>
<City V="Shanghai" />
<Country V="CN" />
<LocationPurpose V="" />
</Party>
<Party PartyType="ST">
<Name V="LEB" />
<LocationID Q="" ID="" />
<AlternateLocationIDs>
<LocationID Q="" ID="LEB" />
</AlternateLocationIDs>
<City V="Lebanon" />
<Country V="TN" />
<LocationPurpose V="" />
</Party>
<Party PartyType="VN">
<Name V="YANGZHOU BAOYI SHOES" />
<LocationID Q="" ID="4100000423" />
<AlternateLocationIDs />
<City V="JIANGSU" />
<Country V="CN" />
<LocationPurpose V="" />
</Party>
</Parties>
<DateReferences>
<DR Type="D" Q="ETA" Date="2019-12-19" />
<DR Type="D" Q="EST" Date="2019-11-28" />
</DateReferences>
<ReservedReferences>
<RR Type="R" Q="K6" V="86|SEAL230946" />
<RR Type="R" Q="V3" V="VYG230946|BKG230946" />
</ReservedReferences>
</DocumentHeader>
<Vessel VesselName="VSL230946" VesselNumber="" VesselCountryOfRegistration="" VesselRegistrationNumber="" />
<Equipments>
<Equipment Initial="CNTR" Number="230946" Length="0" Type="" TotalContainerVolume="52.06" />
</Equipments>
<LineItems>
<LineItem>
<LineItemNumber V="00000000000000000010" />
<LineItemType C="LI" />
<TransportationServiceCode Code="" />
<PurchaseOrderNumber V="0100230946|00010" />
<AdditionalReferenceNumber V="" />
<DescriptionMarksAndNumbers>
<CommodityCode Q="" C="M9160" />
<BuyerProductID V="" />
</DescriptionMarksAndNumbers>
<BilledRatedAsQuantity V="0.0" UOM="PA" />
<LadingQuantity V="0.0" UOM="PA" />
<LineItemTotalAmount V="0.0" />
<LineItemWeight V="0.00" />
<LineItemVolume V="0.00" />
</LineItem>
<LineItem>
<LineItemNumber V="00000000000000900001" /> //this one would not work,because it is 900001
<LineItemType C="LI" />
<LineItemSubType C="SCH" />
<TransportationServiceCode Code="" />
<PurchaseOrderNumber V="0100230946|00010" />
<AdditionalReferenceNumber V="" />
<DescriptionMarksAndNumbers>
<CommodityCode Q="" C="M9160" />
<BuyerProductID V="" />
</DescriptionMarksAndNumbers>
<BilledRatedAsQuantity V="24.0" UOM="PA" />
<LadingQuantity V="24.0" UOM="PA" />
<LineItemTotalAmount V="0.0" />
<UserDefinedReferences>
<UDR Type="U" Q="CR" V="22859470896|001|0001" Description="" />
<UDR Type="U" Q="S6" V="|3|20" Description="" />
<UDR Type="U" Q="19" V="M9160|USDS|0001" Description="" />
</UserDefinedReferences>
<LineItemWeight V="2959.54" />
<LineItemVolume V="104.12" />
</LineItem>
<LineItem>
<LineItemNumber V="00000000000000900002" />
<LineItemType C="LI" />
<LineItemSubType C="SCH" />
<TransportationServiceCode Code="" />
<PurchaseOrderNumber V="0100230946|00010" />
<AdditionalReferenceNumber V="" />
<DescriptionMarksAndNumbers>
<CommodityCode Q="" C="M9160" />
<BuyerProductID V="" />
</DescriptionMarksAndNumbers>
<BilledRatedAsQuantity V="24.0" UOM="PA" />
<LadingQuantity V="24.0" UOM="PA" />
<LineItemTotalAmount V="0.0" />
<UserDefinedReferences>
<UDR Type="U" Q="CR" V="22859470902|001|0002" Description="" />
<UDR Type="U" Q="S6" V="|3.5|20" Description="" />
<UDR Type="U" Q="19" V="M9160|USDS|0001" Description="" />
</UserDefinedReferences>
<LineItemWeight V="2959.54" />
<LineItemVolume V="104.12" />
</LineItem>
I tried to start on LINQ: this is where I got so far:
try {
var xDoc = XDocument.Parse(msg.Body);
var xDocument = xDoc.Root.XPathSelectElement("Groups/Group/Documents/Document");
var xLineItems = xDocument.XPathSelectElements("LineItems/LineItem");
var poNumbers = xLineItems.Select(e => (string)e.Element("PurchaseOrderNumber").Attribute("V")).Distinct();
foreach (var poNumber in poNumbers) {
}
msg.Body = xDoc.ToString();
I believe you would like to Delete all LineItem where LineItemNumber!=10 and PurchaseOrderNumber after the Pipe NOT equals 10. You could use Linq to filter the elements that match the purpose and use the Remove method to deletes the selected nodes.
var xDoc = XDocument.Parse(xml);
xDoc.Descendants("LineItem")
.Where(x=> Convert.ToInt32(x.Element("LineItemNumber").Attribute("V").Value)!=10
&& Convert.ToInt32(x.Element("PurchaseOrderNumber").Attribute("V").Value.Split('|')[1])!=10
).Remove();
var result = xDoc.ToString();

Add href link in custom grid in webform ASP.NET and Get ID of Select Row using JQuery

I am trying to add inside custom grid within template but I cannot see these links in output along with other grid data ....
<cc0:Grid ID="StaffItemList" runat="server" FolderStyle="~/Styles/Grid" AutoGenerateColumns="false"
Width="100%" PageSizeOptions="5,10,20,50,100,-1" AllowFiltering="true" FilterType="ProgrammaticOnly"
AllowAddingRecords="false">
<Columns>
<cc0:CheckBoxSelectColumn ShowHeaderCheckBox="true" Width="50" ControlStyle-CssClass="UserInRoleGrid"></cc0:CheckBoxSelectColumn>
<cc0:Column DataField="id" HeaderText="ID" Visible="true" />
<cc0:Column DataField="loginid" HeaderText="loginid" Width="150" />
<cc0:Column DataField="forenames" HeaderText="forenames" />
<cc0:Column DataField="surnames" HeaderText="surnames" />
<cc0:Column DataField="gender" HeaderText="gender" />
<cc0:Column DataField="email" HeaderText="email" />
<cc0:Column DataField="deleted" HeaderText="deleted" />
</Columns>
<Templates>
<cc0:GridTemplate runat="server" ID="AddUserToRoleLink">
<Template>
addRole
</Template>
</cc0:GridTemplate>
</Templates>
</cc0:Grid>
I have found asnswer; code as following....
<cc0:Grid ID="StaffItemList" runat="server" FolderStyle="~/Styles/Grid" AutoGenerateColumns="false"
Width="100%" PageSizeOptions="5,10,20,50,100,-1" AllowFiltering="true" FilterType="ProgrammaticOnly"
AllowAddingRecords="false">
<Columns>
<cc0:Column DataField="id" HeaderText="ID" Visible="true"/>
<cc0:Column DataField="loginid" HeaderText="loginid" Width="150" />
<cc0:Column DataField="forenames" HeaderText="forenames" />
<cc0:Column DataField="surnames" HeaderText="surnames" />
<cc0:Column DataField="gender" HeaderText="gender" />
<cc0:Column DataField="email" HeaderText="email" />
<cc0:Column DataField="deleted" HeaderText="deleted" />
<cc0:Column DataField="Functions" HeaderText="deleted" >
<TemplateSettings TemplateId="AddUserToRoleControl"/>
</cc0:Column>
</Columns>
<Templates>
<cc0:GridTemplate runat="server" ID="AddUserToRoleControl">
<Template>
Add Role
</Template>
</cc0:GridTemplate>
</Templates>
</cc0:Grid>
jQuery
<script type="text/javascript">
$(document).ready(function () {
$(".AddStaffToRoleLink").on("click", function () {
var selectedStaffID = $(this).attr("id");
alert("this is " + selectedStaffID);
});
});
</script>

apex 4 gantt chart task collapser missing

I used APEX 4.2 to create a Gantt chart with the AnyGantt Library.
When i use a custom XML for the Anygantt Diagram everythign works fine. As soon as i want to use custom datagrids, the collapser is missing.
My XML is the following:
<anygantt> <settings>
<navigation enabled="True" position="Top" size="30">
</navigation>
<editing allow_edit="true">
<rounding>
<date unit="Week" step="1" />
</rounding>
</editing>
<locale>
<date_time_format week_starts_from_monday="True">
<months>
<names>January,February,March,April,May,June,July,August,September,October,November,December</names>
<short_names>Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec</short_names>
</months>
<week_days>
<names>Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday</names>
<short_names>Sun,Mon,Tue,Wed,Thu,Fri,Sat</short_names>
</week_days>
<format>
<full>%yyyy.%MM.%dd.%HH.%mm.%ss</full>
<date>%yyyy.%MM.%dd</date>
<time>%HH.%mm.%ss</time>
</format>
</date_time_format>
</locale>
</settings>
<datagrid enabled="true" width="300">
<columns>
<column attribute_name="Name" width="200" cell_align="Left">
<header>
<text>Name</text>
</header>
<format>{%Name}</format>
</column>
<column width="40" cell_align="Left">
<header>
<text>Stunden</text>
</header>
<format>{%Stunden}</format>
</column>
</columns>
</datagrid>
<styles>
<defaults>
<period>
<period_style>
<bar_style>
<labels>
<label anchor="Center" valign="Center" halign="Center">
<text>{%DISPO} %</text>
<font face="Verdana" size="10" bold="true" color="White">
</font>
</label>
</labels>
</bar_style>
</period_style>
</period>
</defaults>
<period_styles>
<period_style name="test">
<bar_style>
<labels>
<label anchor="Center" valign="Center" halign="Center">
<text>Center</text>
<font face="Verdana" size="10" bold="true" color="White">
</font>
</label>
</labels>
<middle shape="Full">
<fill enabled="true" type="Solid" color="DarkSeaGreen" />
<border enabled="true" color="#FF0000" />
</middle>
</bar_style>
</period_style>
</period_styles>
</styles>
<resource_chart><resources><resource name="AVI" id="5"/>
<resource name="CAB" id="4"/>
<resource name="Test, Test (Test)" id="3-U837751" parent="3"/>
<resource name="PL" id="3"/>
<resource name="Struktur" id="2"/>
</resources><periods><period resource_id="3-U837751" name="NAME-3-U837751" start="2015.07.28 00:00" end="2015.07.31 00:00">
<attributes>
<attribute name="DISPO"><![CDATA[,5]]></attribute>
</attributes>
</period></periods></resource_chart>
You need to add cell_align="LeftLevelPadding" to the column where you want to see the collapser. Something like:
<column attribute_name="Name" width="200" cell_align="LeftLevelPadding">
This is described in KB: http://support.anychart.com/customer/portal/articles/2077851--anygantt-4-x-collapser-is-missing-in-datagrid-column
You can find more info on columns at
http://6.anychart.com/products/anygantt/docs/users-guide/index.html?columns.html

Get all radcombobox client id dynamically

In Telerik Control, how to get a radcombobox id?
For example, the below code gets the value of RadCombox1 Client ID. If there is 5 radcomboboxes in my page (sample.aspx), how to get the corresponding id DYNAMICALLY.........
{
var combo = $find("<%= RadComboBox1.ClientID %>");
}
Thanks in Advance,
Ganesan A
Added More :
Thanks for your quick reply. Am using Telerik Control in c#.
a) am using no of radcombobox, raddatepicker, radtimepicker and raddatetimpicker in one page like below
<telerik:RadSplitter ID="RadSplitter1" runat="server" OnClientLoaded="OnClientLoaded">
<telerik:RadPane ID="RadPane1" runat="server">
<telerik:RadComboBox ID="RadComboBox1" CssClass="cmb_bx" runat="server">
<Items>
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" />
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" />
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" />
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem4" />
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem5" />
</Items>
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
<telerik:RadComboBox ID="ComboBox" CssClass="cmb_bx" runat="server">
<Items>
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" />
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" />
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" />
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem4" />
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem5" />
</Items>
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
<telerik:RadDatePicker ID="RadDatePicker1" runat="server">
</telerik:RadDatePicker>
<telerik:RadDatePicker ID="SupplierName" runat="server">
</telerik:RadDatePicker>
<telerik:RadDatePicker ID="CorporateCode" runat="server">
</telerik:RadDatePicker>
<telerik:RadDatePicker ID="PartNo" runat="server">
</telerik:RadDatePicker>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</telerik:RadPane>
<telerik:RadPane ID="RadPane2" runat="server">
</telerik:RadPane>
</telerik:RadSplitter>
b) when i scroll the page, radcombobox or any other control which i had mentioned above also scrolling with the page. it doesn't hide. So i am using the below javascript coding
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function OnClientLoaded(sender, eventArgs)
{
var pane = sender.getPaneById("<%= RadPane1.ClientID %>");
var contentElement = pane.getContentElement();
contentElement.onscroll = function () {
var combo = $find("<%= RadComboBox1.ClientID %>");
alert(combo.get_id());
var dtpkr = $find("<%= RadDatePicker1.ClientID %>");
var dropDown = combo.get_dropDownVisible();
var dropDown1 = dtpkr.isPopupVisible();
if (dropDown) {
combo.hideDropDown();
}
else if (dropDown1) {
dtpkr.togglePopup();
}
};
}
</script>
</telerik:RadCodeBlock>
c) This will hide RadcomboBox1 and RadDatePicker1 only. How can i write the code for more than one Radcombobox and Raddatepicker in one page.
Thanks
Ganesan A
You should specify what language, but this might help. This is for C#.
for (int i = 1; i < 6; i++)
{
string comboBoxName = "RadComboBox" + i.ToString();
var comboObject = (this.FindName(comboBoxName) as RadComboBox); //this returns the object if the name is found
//access the clientID
if( comboObject != null)
var clientid = comboObject.ClientID;
}
Since you already know what to do with the RadComboBoxes and RadDatePickers once you have them, I'll simply point out how to grab all the RadControls of a particular type and let you augment your code.

Looking for code to update a textbox on a SpreadsheetML doc (client using VB.Net but I can read and convert C#)

I have a 2010 Excel Spreadsheet (OpenXML) with a textbox "LengthVariableTextBox" on it. I wish to change the textbox value (currently ##.# just as a placeholder) using the openxml SDK with VB.Net (perfered) or C#. Below is a XML fragment from drawing7.xml showing the textbox.
Thanks for the Help!
M. Scott Blalock
<xdr:twoCellAnchor>
<xdr:from>
<xdr:col>2</xdr:col>
<xdr:colOff>502920</xdr:colOff>
<xdr:row>8</xdr:row>
<xdr:rowOff>45720</xdr:rowOff>
</xdr:from>
<xdr:to>
<xdr:col>3</xdr:col>
<xdr:colOff>510540</xdr:colOff>
<xdr:row>9</xdr:row>
<xdr:rowOff>76200</xdr:rowOff>
</xdr:to>
<xdr:sp macro="" textlink="">
<xdr:nvSpPr>
<xdr:cNvPr id="287" name="3:24 PM 9/19/2012" />
<xdr:cNvSpPr txBox="1" />
</xdr:nvSpPr>
<xdr:spPr>
<a:xfrm>
<a:off x="1722120" y="1386840" />
<a:ext cx="617220" cy="198120" />
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst />
</a:prstGeom>
<a:solidFill>
<a:schemeClr val="tx1" />
</a:solidFill>
<a:ln w="9525" cmpd="sng">
<a:solidFill>
<a:schemeClr val="lt1">
<a:shade val="50000" />
</a:schemeClr>
</a:solidFill>
</a:ln>
</xdr:spPr>
<xdr:style>
<a:lnRef idx="0">
<a:scrgbClr r="0" g="0" b="0" />
</a:lnRef>
<a:fillRef idx="0">
<a:scrgbClr r="0" g="0" b="0" />
</a:fillRef>
<a:effectRef idx="0">
<a:scrgbClr r="0" g="0" b="0" />
</a:effectRef>
<a:fontRef idx="minor">
<a:schemeClr val="dk1" />
</a:fontRef>
</xdr:style>
<xdr:txBody>
<a:bodyPr vertOverflow="clip" wrap="square" rtlCol="0" anchor="t" />
<a:lstStyle />
<a:p>
<a:r>
<a:rPr lang="en-US" sz="1100">
<a:solidFill>
<a:schemeClr val="bg1" />
</a:solidFill>
</a:rPr>
<a:t>##.#</a:t>
</a:r>
</a:p>
</xdr:txBody>
</xdr:sp>
<xdr:clientData />
</xdr:twoCellAnchor>
Here is the answer:
http://social.msdn.microsoft.com/Forums/en-US/oxmlsdk/thread/3eb9075a-de13-4f4a-a83d-c42cdb6b8e98

Resources