Grid view display issue - asp.net

I have a data table which display like below in grid view and I done edit, update & cancel operation on it, it will work fine
ID | Title | Number | State
585344 issue 1 140024 In progress
But I want to display it like below in grid view and doing Edit, update & cancel operation on it, How to do please help....
ID-585344
Title-issue 1
Number-140024
State-In progress

I would suggest instead of going for gridview go for Listview (as you are using .Net 4.0), you can easily achieve desired output.

Related

Loop over cards in the UI

Is there someone who can tell me how you loop over the contacts in the template "Vendor ratings" please ?
I give you a screenshot of the page. To reproduce, go to the "Contacts" page, add a new contact and see two contacts...
I want to do the same behavior for my application and I don't know how to loop...
When I create a single card with a label binding #datasource.item.name for example, I only have 1 card displayed although in my datasource I have two results...
Thanks a lot for your help.
You are looking for widgets that can render repetitive data: List, Accordion, Grid. You can build prototype row/cell inside such widget, bind it to array of items (datasource) and App Maker's runtime will take care about the rest for you:

Read from sqlserver and insert each line values to a table cell programmatically or from design

I am working on a Dotnetnuke module and i try to read the products i have in my sql server database.
I managed to read the data from the asp tools LinqDataSource and ive inserted them in listview etc. This is now what i need.
The ideal would be if i could read from database my table, and for each row on the db.table to dinamically create a asp:table cell in the design. The asp table ould be 4x5. so 4 columns and 5 rows, and each cell would include an image and the text i load from the database(the image wont load from db, its the same image for all products).
Also if there are more than 20 products then a 2nd page is created with the rest, and page navigation at the bottom.
this is the result i want.
I didnt try much programmatically as i dont really know how to start this. Only from design i tried a few things but they are like a listview so it doesnt help much.
Any ideas or suggestions people?
I managed to make the interface of the picture i provided and made all products clickable, all this from the design view with a ListView.
You can ask if you want any details

.NET dropdownlists with huge number of items

I am working on a webpart which makes use of 5 dropdowns (each dropdown represents 'Project' table columns like projectNo, ProjectPM, ContractNo etc). The table has more than 3000 items, so when the dropdownlists are finally databound, they have more than 3000 items to load, which pretty much brings IE to a halt.
What is the best way to go about architecting a solution, so users can still make use of the dropdown list interface, may be like first rendering an empty dropdownlist and then using a modal window to first find the project number they are looking for and then set the item as selected in the dropdownlist. I am envisioning the following UI. Can anyone guide me on how I should go about solving this issue?
-------------------
|V| [SearchBtn]
-------------------
-------------------
|V| [SearchBtn]
-------------------
-------------------
|V| [SearchBtn]
-------------------
[FindProjectBtn]
Clickikng on the searchBtn basically brings up a popup window where they can search for their stuff, and when they click on the matched result, it will set the dropdownlist.
When working with dropdown lists, a good rule-of-thumb is to keep the list short so you do not experience browser performance issues. If you have thousands of items to look through you can:
Create a search component whereby the user enters a part of the project name they are searching for and display a simple grid for them to choose from.
Implement a type-ahead mechanism. The user enters the first couple of letters of what they are searching for. You can query your DB for the top 10 hits and return them via AJAX.
If you have 3000 items, then definitely drop down list will not be a right designing decision.
using any kind of repeater lists with paging, sorting and searching functions is highly recommended in your case.
but if you insist to have a kind of drop down list view then Matthew's suggestions are your answer.

How should I display datatable in multiple pages?

IN summary . I have an ASPX page. and a button. Clicking the button will load the result based on the parameter the user specified. The problem is if the result is too much, the page is too slow to load.
AS I am writing my question. basically I need suggestion as to which approach is the best practice?
OPTION 1 is it possible for the ASPX page to load in chunks and as the user scroll, more result will be displayed. if so, where do I start reading and how do I do it?
OPTION 2 fix the function behind the button to display 10 records at a time. and add another button such as next page or previous page
OPTION 3 It would be nice , if I know what I am doing, is to show progress to the user, what the code is doing . a nice progress bar.. showing loading .. 10% done, 20% done.. 100% done.. . at least the user is not just watching Internet explorer spinning icon...
ugh, Apologize as this becomes a really long post..
I have a function that loop through a datatable (DT). Lets call this function displayImages.
The DT may have 200 records. what's inside DT, is a list of filenames.
DisplayImages function, determine where the file is located and display the result into the user. The end result is HTML tag like
img src="path/filename.jpg"
I have other routines in displayimages function, but for the sake of simplicity lets just say the displayimages function only loops through DT and spits out the img src="path/filename.jpg"
The problem I am currently having is that displayimages function is too slow to complete all 200 results. And my attempt to give the user some feedback to show where the loop is at has not work very well (I don't know how to make a nice progress bar to show end user what the loop is doing inside displayimages function)
So I have this Idea of displayimages function to show only 10 records at a time. and a user then click a link button or ASPX button. page 1 , page 2 and show on, to display the next result.
I read I can use pagingdatasource. but I am wondering if there is a clever way to just loop the datatable from row 1 to 10
then row 11 to 20
and so on...
I guess my problem is how can I keep that datatable in memory so I can keep referring to it.
I do have an identifier set in the datatable if that can be any help?
Please let me know your suggestion.. Thank you
This is an ASPX website with VB.net code behind
Thanks in advance
In the end I end up with option number 2.
I am not using sql data source in my code. but I only use datatable.
so to achieve option 2 (which is to display 10 records at one time. and the user has the ability to click page 1 page 2 page 3) I use gridview and css.
Gridview is set to display 10 results at one time.
And as the gridview is irrelevant for the user I use CSS to hide all the contents. but only show the pagination row (the last row)
as I am learning to code in asp.net and vb.net I wish to be able to do option 1 or option 3.
I am hoping I will be able to learn how to do it in the near future.
Thanks!

Loading different control in different row of Telerik Grid in EDIT mode

I want to load different controls like DROPDOWN,RADIO in single column in Telerik Rad Grid's edit mode.
Means in every row, i want to pass some value from database like
id | control|
1 | dropdown
2 | radio
3 | checkbox
now when i pass 1 in column , telerik grid should load dropdownbox in edit mode.
in another row if i pass 2 than in same column but in that perticular row it should load radio button in edit mode.
Is it possible to do?
you have to set AutoGenerateColumns="False" and then create your custom "RadGridTemplateColumn"'s in your ascx-file.
In each TemplateColumn you can define "HeaderTemplate", "ItemTemplate", "EditTemplate". The EditTemplate will be shown if you are in edit mode.
In this you can show your controls.
Iam not sure what you exactly mean but I think you wanna show a dropdownlist in the Row 0 of your grid and in the next item (Row 1) you wanna show at the same position a radiobuttonlist right?
You can achive this by using the Event "OnItemDataBound".
if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
{
}
use this to be sure that you are in the editmode.
There you can for example hide some controls or maybe create them dynamically and add them to the page.
If you wanna create new controls dynamically I would suggest you to place a asp:PlaceHolder at the specific position in your ascx-file.
hope I understood you right.
best regards, noone.

Resources