how to bind images horizontally in datagrid
-
i want to bind images horizontally using datagrid i don't want to use listbox because i m binding images directly from sql server table on rowbinding event datagrid.
One person's data is another person's program. --J.Walia
A list box can be used with an
ItemsPanelTemplate
tag and a StackPanel to achieve this[^]. If your binding is done correctly, I dont think you should need the rowbinding event of the datagrid. Use an ObservableCollection to bind to the list box.There are only 10 types of people in this world — those who understand binary, and those who don't.
-
A list box can be used with an
ItemsPanelTemplate
tag and a StackPanel to achieve this[^]. If your binding is done correctly, I dont think you should need the rowbinding event of the datagrid. Use an ObservableCollection to bind to the list box.There are only 10 types of people in this world — those who understand binary, and those who don't.
Hi abhinav thanks for reply Actually i m binding images directly from datagrid. for this purpose i am generic handler. i bind the images to image control on rowbinding event of datagrid. In listbox i dint find rowbinding event. http://dotnetcurry.com/ShowArticle.aspx?ID=264
One person's data is another person's program. --J.Walia
-
Hi abhinav thanks for reply Actually i m binding images directly from datagrid. for this purpose i am generic handler. i bind the images to image control on rowbinding event of datagrid. In listbox i dint find rowbinding event. http://dotnetcurry.com/ShowArticle.aspx?ID=264
One person's data is another person's program. --J.Walia
J walia wrote:
Actually i m binding images directly from datagrid. for this purpose i am generic handler. i bind the images to image control on rowbinding event of datagrid.
So the bindings work but you need to arrange Image elements horizontally? What are you trying to do once the Image elements have their bindings?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
J walia wrote:
Actually i m binding images directly from datagrid. for this purpose i am generic handler. i bind the images to image control on rowbinding event of datagrid.
So the bindings work but you need to arrange Image elements horizontally? What are you trying to do once the Image elements have their bindings?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
i want arrange image controls horizontally
One person's data is another person's program. --J.Walia
J walia wrote:
i want arrange image controls horizontally
Grid, StackPanel, Canvas are some elements that can have child elements arranged horizontally.
<StackPanel Orientation="Horizontal" >
<Image .../>
<Image .../>
<Image .../>
</StackPanel>For data coming from a collection, you could use an ItemsControl or derived. Do you have an example or some details of what you want, or something you tried that didn't work?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
J walia wrote:
i want arrange image controls horizontally
Grid, StackPanel, Canvas are some elements that can have child elements arranged horizontally.
<StackPanel Orientation="Horizontal" >
<Image .../>
<Image .../>
<Image .../>
</StackPanel>For data coming from a collection, you could use an ItemsControl or derived. Do you have an example or some details of what you want, or something you tried that didn't work?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
but these controls does't have row binding event
One person's data is another person's program. --J.Walia
J walia wrote:
these controls does't have row binding event
What is a row binding event (what event are you referring to) and why do you think you need it?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
J walia wrote:
these controls does't have row binding event
What is a row binding event (what event are you referring to) and why do you think you need it?
Mark Salsbery Microsoft MVP - Visual C++ :java:
Hello Mark Please check this link http://dotnetcurry.com/ShowArticle.aspx?ID=264 I have used same logic. please help now i need this badly.
One person's data is another person's program. --J.Walia
-
Hello Mark Please check this link http://dotnetcurry.com/ShowArticle.aspx?ID=264 I have used same logic. please help now i need this badly.
One person's data is another person's program. --J.Walia
J walia wrote:
I have used same logic.
Thanks. So you are using the LoadingRow event....so what are you trying to do in your LoadingRow event handler? Do you have multiple images per row instead of one like the sample?
Mark Salsbery Microsoft MVP - Visual C++ :java: