gridview

Displaying images from specific folder in sd card in grid view

夙愿已清 提交于 2019-12-29 07:17:09
问题 I had developed an application in which I have to display images from specific folder in sd card. My code is working fine but it is showing all images that are sd card. I had given selection args as my folder's name as it has been metioned the following post: Displaying images from a specific folder on the SDCard using a gridview But, it didn't worked. Please, suggest me how to do this: Below I am posting my code. public class Album1Activity extends Activity { static Cursor imageCursor;

Dynamically change GridView item template

左心房为你撑大大i 提交于 2019-12-29 06:52:34
问题 I have a fairly big asp.net website that use GridView bound to the same object in lots of places. I'm using an item template to customize each row. However to have the same template in all the pages I have to copy & paste the item template to each page. Obviously this is not the best solution. On top of this I want to be able to change the template used by the GridView, by changing some configuration file. One option would be to create an user control with the DataGrid and expose the

Android set the GridView to have 2 columns per row only

江枫思渺然 提交于 2019-12-29 04:31:07
问题 Here is my code in my Activity: public class GridViewActivity extends Activity { GridView gridView; static final String[] MOBILE_OS = new String[] { "Android", "iOS", "Windows", "Blackberry" }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); gridView = (GridView) findViewById(R.id.gridView1); gridView.setAdapter(new ImageAdapter(this, MOBILE_OS)); gridView.setOnItemClickListener(new OnItemClickListener() { public

ASP.NET GridView second header row to span main header row

眉间皱痕 提交于 2019-12-29 02:45:30
问题 I have an ASP.NET GridView which has columns that look like this: | Foo | Bar | Total1 | Total2 | Total3 | Is it possible to create a header on two rows that looks like this? | | Totals | | Foo | Bar | 1 | 2 | 3 | The data in each row will remain unchanged as this is just to pretty up the header and decrease the horizontal space that the grid takes up. The entire GridView is sortable in case that matters. I don't intend for the added "Totals" spanning column to have any sort functionality.

Selectively apply css to a row in a gridview

吃可爱长大的小学妹 提交于 2019-12-28 12:06:10
问题 I'm looking for a way to selectively apply a CSS class to individual rows in a GridView based upon a property of the data bound item. e.g.: GridView's data source is a generic list of SummaryItems and SummaryItem has a property ShouldHighlight . When ShouldHighlight == true the CSS for the associated row should be set to highlighted any ideas? 回答1: very easy protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) {

Selectively apply css to a row in a gridview

妖精的绣舞 提交于 2019-12-28 12:05:09
问题 I'm looking for a way to selectively apply a CSS class to individual rows in a GridView based upon a property of the data bound item. e.g.: GridView's data source is a generic list of SummaryItems and SummaryItem has a property ShouldHighlight . When ShouldHighlight == true the CSS for the associated row should be set to highlighted any ideas? 回答1: very easy protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) {

Change header text of columns in a GridView

好久不见. 提交于 2019-12-28 11:51:47
问题 I have a GridView which i programmatically bind using c# code. The problem is, the columns get their header texts directly from Database, which can look odd when presented on websites. So basically, i would like to modify the column header text, but programmatically. i have already tried the following, testGV.Columns[0].HeaderText = "Date"; and this.testGV.Columns[0].HeaderText = "Date"; does not seem to give me correct result. 回答1: You should do that in GridView's RowDataBound event which is

Why isn't the dropdownlist found by “FindControl” of GridViewRow?

此生再无相见时 提交于 2019-12-28 07:07:11
问题 Two exceptions: Index out of bound FindControl returns null (it's pretending or not detecting the controls) cs code: (for now dropdownlist just needs to be populated at editing mode) protected void GridView3_RowEditing(object sender, GridViewEditEventArgs e) { GridView3.EditIndex = e.NewEditIndex; ShowData("a"); //bind data GridViewRow gVR = GridView3.Rows[GridView3.EditIndex]; aspx code: <asp:TemplateField HeaderText="x" ItemStyle-CssClass="ix"> <EditItemTemplate> <asp:DropDownList ID=

Prevent user from resizing columns with WPF ListView

人盡茶涼 提交于 2019-12-28 06:18:34
问题 How can I prevent a user from resizing GridViewColumns withing a ListView control? 回答1: For those looking for a quicker and simpler answer. Set IsEnabled to False in the ColumnHeaderContainerStyle. This will prevent the user from resizing. Like this: <GridView.ColumnHeaderContainerStyle> <Style TargetType="{x:Type GridViewColumnHeader}"> <Setter Property="IsEnabled" Value="False"/> </Style> </GridView.ColumnHeaderContainerStyle> If you want to fix the disabled grayed out color add a trigger

GridView with 2 columns, fill width

不想你离开。 提交于 2019-12-28 02:56:26
问题 The result I want to achieve is pretty simple, a list with 2 columns, both with equal width. In Windows Phone 7/8 this could easily be achieved using a ListBox with a WrapPanel as ItemsPanel and setting the ItemWidth to 240 (as the screen width was 480). Now I'm Writing a Universal App, but here the problem is that the screen is not guaranted to have a width of 480 (not even for the Phone it seems) so I can't set the ItemWidth as I want it to fill the width of the screen. I have been able to