Datagrid

manu222 Messages postés 56 Date d'inscription vendredi 4 mars 2005 Statut Membre Dernière intervention 22 novembre 2018 - 27 juin 2008 à 16:19
manu222 Messages postés 56 Date d'inscription vendredi 4 mars 2005 Statut Membre Dernière intervention 22 novembre 2018 - 30 juin 2008 à 15:39
Bonjour
 J ais recuperer le code de Syndi74 (tres compact et efficace) pour transferer un fichier XML dans un DataGrid...c est genial ca marche du tonnerre.

<li>Dim DS As DataSet = New DataSet
</li><li>Dim uneTable As DataTable
</li><li>Dim unevue As DataView
</li><li>Dim dat AsDate</li><li>Dim myfiltre AsString</li><li>
</li><li> dat = Date.Now.Date</li><li> DS.ReadXml("RDV.xml")
</li><li> uneTable = DS.Tables(0)
</li><li> unevue = New DataView(uneTable)
</li><li> ( Optionnel) myfiltre = "date='" + CStr(dat).ToString + "'" </li><li> (Optionnel ) unevue.RowFilter = myfiltre
</li><li>Me.DGRDV.DataSource = unevue</li>recuperer les donnees du contenue de la Row(i) pas de problemes en faisant ci-dessous:
d = MyDataView.Table.Rows.Item(i).ItemArray(i)   
Mon probleme est que je ne sais pas comment faire pour recuperer les données (child un truc dans ce style )qui sont attachées a la Row(i)..et puis afficher en mode déroulé les lignes comment faut il faire.
merci

4 réponses

simo5963 Messages postés 127 Date d'inscription vendredi 12 octobre 2007 Statut Membre Dernière intervention 24 mars 2009 1
28 juin 2008 à 14:45
Bonjour;








'''
<summary>






''' cette méthode va remplir le combo selon les données d'une ligne d'une datagrid






'''






'''
</summary>






'''








'''








'''
<remarks></remarks>






Public



Sub
Extraire(

ByVal
i

As



Integer
,

ByVal
Data

As
DataGridView,

ByVal
Combo

As
ComboBox) 

Combo.Items.Clear()


For
j

As



Integer
= 0

To
Data.ColumnCount - 1


If
Data.Rows(i).Cells(j).Value <>

String
.Empty

Then

Combo.Items.Add(Data.Rows(i).Cells(j).Value)







Else

Combo.Items.Add(




"Nothing"
)


End



If 

 








Next

Combo.Text = Combo.GetItemText(Combo.Items(0))







End



Sub

Merci!!!!

_________________________________________________
 Sun [J2EE] > Microsoft [.NET]

/FONT>
0
manu222 Messages postés 56 Date d'inscription vendredi 4 mars 2005 Statut Membre Dernière intervention 22 novembre 2018
30 juin 2008 à 09:43
bonjour et merci pour ta reponse ....mais ca le fait pas.
0
simo5963 Messages postés 127 Date d'inscription vendredi 12 octobre 2007 Statut Membre Dernière intervention 24 mars 2009 1
30 juin 2008 à 15:06
Détailler un peu votre problème;

Merci;

_________________________________________________
 Sun [J2EE] > Microsoft [.NET]

<>
0
manu222 Messages postés 56 Date d'inscription vendredi 4 mars 2005 Statut Membre Dernière intervention 22 novembre 2018
30 juin 2008 à 15:39
j ais un fichier XML (ci-dessous juste un morceau) que je transfere dans un datagrid. ( ca marche parfaitement bien.)
une fois l'operation faite dans ma dataGrid j'ais plusieur colonnes avec differents intitulés.( c est corret )
il y a aussi une centaine de lignes...c est correct aussi..;)
mais il y a aussi pour chaque ligne des propietes accessible, je pense
que c'est des ChildRelation ou un truc dans le genre....et moi je
voudrais acceder facilement a ces childrelation en selectionnant la
ligne

dans la syntaxe du datagrid je n'arrive pas a acceder au champs correspondant a la table Properties "Base Price" "Mass".....

<style><![CDATA[ODY{font:x-small 'Verdana';margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}]]></style>
<?xml version= "1.0" ?>

[# -]<ArrayOfShip xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance " xmlns:xsd ="http://www.w3.org/2001/XMLSchema">

[# -]<Ship Id= " 24692 "
Name ="Abaddon" Description= "The Abaddon class ship is a
celestial tool of destruction. It is designed to enter combat from the outset,
targeting enemies at range and firing salvo after salvo at them, and to remain
intact on the battlefield until every heretic in sight has been torn to shreds.
Special Ability: 5% bonus to Large Energy Turret damage and 5% armor resistance
per level." Race=" Amarr "
Type ="Battleship">

[# -]<Properties>

 <propName= " Base price "
Value ="180,000,000 ISK" />

 <propName= " Mass "
Value ="117,500,000.00 kg" />

 <propName= " Volume "
Value ="495,000.00 m3" />

 <propName= " Capacity "
Value ="525.00 m3" />

 <propName= " Inertia Modifier "
Value ="0.155" />
 <propName" Armor Em Damage Resistance " Value"-60 %" />
 <propName" Armor Explosive Damage Resistance " Value"-20
%" />

 <propName= " Armor Hitpoints "
Value ="8,500 HP" />
 <propName" Armor Kinetic Damage Resistance " Value"-25
%" />
 <propName" Armor Thermal Damage Resistance " Value"-35
%" />

 <propName= " armorUniformity "
Value ="0.75" />

 <propName= " Ship Warp Speed "
Value ="1.00" />

 <propName= " Capacitor Capacity "
Value ="6,375.00 Energy" />

 <propName= " CPU Output "
Value ="560 tf" />

 <propName= " Drone Bandwidth "
Value ="75.00 Mbit/sec" />

 <propName= " Drone Capacity "
Value ="75.00 m3" />

 <propName= " EM dmg resistance "
Value ="0 %" />
 <propName" Explosive dmg resistance " Value"0 %" />

 <propName= " gfxBoosterID "
Value ="394" />

 <propName= " heatAttenuation "
Value ="0.82" />

 <propName= " heatAttenuationMed "
Value ="0.79" />

 <propName= " heatAttenuationMed "
Value ="0.63" />

 <propName= " heatCapacityHi "
Value ="100.00" />

 <propName= " heatCapacityLow "
Value ="100.00" />

 <propName= " heatCapacityMed "
Value ="100.00" />

 <propName= " heatDissipationRate "
Value ="0.01" />
 <propName" heatDissipationRateLow " Value"0.01" />
 <propName" heatDissipationRateHi " Value"0.01" />
 <propName" heatGenerationMultiplier " Value"0.50" />

 <propName= " High Slots "
Value ="8 Fitting slots" />
 <propName" hp " Value"8,000 HP"
/>
 <propName" Kinetic dmg resistance " Value"0 %" />

 <propName= " Launcher hardpoints "
Value ="1"
/>

 <propName= " Low Slots "
Value ="7 Fitting slots" />
 <propName" maxDirectionalVelocity " Value"1,000.00" />

 <propName= " Max Locked Targets "
Value ="7"
/>

 <propName= " maxPassengers "
Value ="1,000" />
 <propName" Maximum Targeting Range " Value"80,000.00 m" />

 <propName= " Max Velocity "
Value ="110 m/sec" />

 <propName= " Med Slots "
Value ="4 Fitting slots" />
 <propName" minTargetVelDmgMultiplier " Value"0.50" />

 <propName= " powergrid Output "
Value ="21,000 MW" />

 <propName= " powerToSpeed "
Value ="1"
/>
 <propName" Fusion Propulsion Strength " Value"8.00 points" />

 <propName= " propulsionGraphicID "
Value ="394" />
 <propName" Ion Propulsion Strength " Value"0.00 points" />
 <propName" Magpulse Propulsion Strength " Value"0.00 points" />
 <propName" Plasma Propulsion Strength " Value"0.00 points" />

 <propName= " Recharge time "
Value ="1,250,000.00 ms" />

 <propName= " Rig Slots "
Value ="3 Fitting slots" />
 <propName" Gravimetric Sensor Strength " Value"0.00 points" />
 <propName" LADAR Sensor Strength " Value"0.00 points" />
 <propName" Magnetometric Sensor Strength " Value"0.00 points" />
 <propName" RADAR Sensor Strength " Value"22.00 points" />

 <propName= " Scan Resolution "
Value ="85.00 mm" />

 <propName= " Targeting Speed "
Value ="7,500 ms" />

 <propName= " Shield Capacity "
Value ="7,000.00 HP" />
 <propName" Shield Em Damage Resistance " Value"0 %" />
 <propName" Shield Explosive Damage Resistance " Value"-60
%" />
 <propName" Shield Kinetic Damage Resistance " Value"-40
%" />

 <propName= " Shield recharge time "
Value ="2,500,000.00 ms" />
 <propName" Shield Thermal Damage Resistance " Value"-20
%" />

 <propName= " Shield Uniformity "
Value ="0.75" />

 <propName= " shipBonusAB "
Value ="-5"
/>

 <propName= " shipBonusAB2 "
Value ="5.00" />

 <propName= " Signature Radius "
Value ="470.00 m" />

 <propName= " structureUniformity "
Value ="0.75" />
 <propName" Thermal dmg resistance " Value"0 %" />

 <propName= " Turret hardpoints "
Value ="8"
/>

 <propName= " uniformity "
Value ="1.00" />

 <propName= " Calibration "
Value ="400.00 points" />

 <propName= " Upgrade Hardpoints "
Value ="3"
/>

 <propName= " warpCapacitorNeed "
Value ="0.00" />

 <propName= " warpFactor "
Value ="0.00" />
 <propName" Warp Speed Multiplier " Value"1.00 x" />

 </Properties>

[# -]<RequiredSkills>

 <skillName= " Amarr Battleship "
Level ="3"
/>

 </RequiredSkills>

 </Ship>

</ArrayOfShip>

je sais c est pas evident a explequer....courage.
0
Rejoignez-nous